Skip to content

Commit

Permalink
fix cold shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Sep 12, 2013
1 parent 8574a40 commit 1d3de25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions kuyruk/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ def cold_shutdown(self):
logger.warning("Cold shutdown")
self.shutdown_pending.set()
self.shutdown_workers(kill=True)
sys.exit(0)
os._exit(0)

def abort(self):
"""Exit immediately making workers orphan."""
logger.warning("Aborting")
sys.exit(0)
os._exit(0)

def get_stats(self):
"""Generate stats to be sent to manager."""
Expand Down Expand Up @@ -190,8 +190,6 @@ def run_worker(self):
logger.debug("Running worker command")
run_worker(self.kuyruk, args)

sys.exit(0)

def close_fds(self):
logger.debug("Closing open file descriptors...")
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
Expand Down
2 changes: 1 addition & 1 deletion kuyruk/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def warm_shutdown(self):

def cold_shutdown(self):
logger.warning("Cold shutdown")
sys.exit(0)
os._exit(0)

def maybe_start_manager_thread(self, socket_lock=None):
if self.config.MANAGER_HOST:
Expand Down
2 changes: 1 addition & 1 deletion kuyruk/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def handle_sigquit(self, signum, frame):
logger.critical("Cannot send ACK for the current task.")
traceback.print_exc()
logger.warning("Exiting...")
sys.exit(0)
os._exit(0)

def quit_task(self):
self.handle_sigquit(None, None)
Expand Down

0 comments on commit 1d3de25

Please sign in to comment.