2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 04:50:21 +00:00

Prevent control thread from blocking exit

If a control socket was created, exit() would block due to the non-daemon thread.
 Mark the thread as daemon to allow for unclean shutdown.
This commit is contained in:
Jarrod Johnon 2014-10-07 15:30:29 -04:00
parent b2102bae30
commit 9d7aa2c51f

View File

@ -37,7 +37,9 @@ class TermHandler(object):
atexit.register(self.shutdown)
self.socket.bind(path)
os.chmod(path, stat.S_IWUSR | stat.S_IRUSR)
threading.Thread(target=self.sockinteract).start()
th = threading.Thread(target=self.sockinteract)
th.daemon = True
th.start()
def shutdown(self):
try: