Skip to content

Commit

Permalink
* join timeout of elasticbu script in case of hanging inotify thread …
Browse files Browse the repository at this point in the history
…when monitored directory is deleted

* os._exit used to finally exit elasticbu process
* fixed waiting for elastic process (wrong variable name was used)
  • Loading branch information
smorovic committed Mar 17, 2015
1 parent 877eb76 commit 2735f90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions python/aUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ def register_inotify_path(self,path,mask):
def start_inotify(self):
self.inotifyWrapper.start()

def stop_inotifyTimeout(self,timeout):
self.logger.info("MonitorRanger: Stop inotify wrapper")
self.inotifyWrapper.stop()
self.logger.info("MonitorRanger: Join inotify wrapper")
self.inotifyWrapper.join(timeout)
if self.inotifyWrapper.isAlive():
self.logger.info("MonitorRanger: Inotify wrapper join timeout ("+str(timeout)+")")
return False
else:
self.logger.info("MonitorRanger: Inotify wrapper returned")
return True

def stop_inotify(self):
self.logger.info("MonitorRanger: Stop inotify wrapper")
self.inotifyWrapper.stop()
Expand Down
8 changes: 4 additions & 4 deletions python/elasticbu.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,9 @@ def checkBoxes(self,dir):

def waitForAnelasticMon(self):
try:
self.parent.elastic_process.wait()
self.parent.elastic_monitor.wait()
except:pass
self.parent.elastic_process = None
self.parent.elastic_monitor = None

def run(self):

Expand Down Expand Up @@ -799,8 +799,8 @@ def stop(self):

logging.info("Closing notifier")
if mr is not None:
mr.stop_inotify()
mr.stop_inotifyTimeout(1)

logging.info("Quit")
sys.exit(0)
os._exit(0)

2 changes: 1 addition & 1 deletion scripts/hltdrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ cd $TOPDIR
cat > hltd.spec <<EOF
Name: hltd
Version: 1.6.3
Release: 0
Release: 1
Summary: hlt daemon
License: gpl
Group: DAQ
Expand Down

0 comments on commit 2735f90

Please sign in to comment.