Skip to content
Snippets Groups Projects
Commit 30b01cf1 authored by Lukas Fritz Marti's avatar Lukas Fritz Marti
Browse files

Added timeout before adding ERS handlers when a partition starting up is found.

parent 15e36b19
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ class CheckThread(threading.Thread):
self.ERS_enabled = self.conf.ERS_enabled
self.partition = self.conf.partition
self.LogLevel = self.conf.LogLevel
self.ERSTimeout = self.conf.ERSTimeout
##### Define Thread internal variables #####
self.exitFlag = False
......@@ -71,6 +72,7 @@ class CheckThread(threading.Thread):
##### Check for a new partition #####
if IPCPartition(self.partition).isValid() and not self.ers_flag:
self.event.wait(self.ERSTimeout)
self.logInfo = {'file':self.check_logger.findCaller()[0],'line':self.check_logger.findCaller()[1]}
self.check_logger.info('Found partition %s, adding ERS' % self.partition, extra = self.logInfo)
self.ers_flag = True
......@@ -85,14 +87,8 @@ class CheckThread(threading.Thread):
self.ers_flag = False
##### Remove ERS handlers from all loggers #####
self.change_state_ers(False)
#print "checkloggers handlers", self.check_logger.handlers
#print "copythreads handlers", self.copy.logger.handlers
#print "del threads handlers", self.delete.logger.handlers
#print "managers handlers", self.manager.logger.handlers
#print "main's loggers handlers", self.logger.handlers
self.event.wait(self.CheckTimeout)
# end while
# end def run()
......
......@@ -192,5 +192,8 @@ DeleteTimeout: 2
MigDelay: 600
########## CHECK THREAD ##########
# Time between checks for partition
CheckTimeout: 2
# Time (s) between checks for partition
CheckTimeout: 1
# Timout (s) before adding the ERS handler
ERSTimeout: 10
......@@ -211,3 +211,5 @@ class Conf:
########## CHECK THREAD ##########
self.CheckTimeout = cfg.CheckTimeout
self.ERSTimeout = cfg.ERSTimeout
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment