mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 17:38:54 +00:00
If worker forked process didn't exit cleanly, update job
This commit is contained in:
parent
34627f5e60
commit
bcd018d8de
@ -150,6 +150,13 @@ class Worker(threading.Thread):
|
||||
else:
|
||||
logging.info("[%s] Waiting for pid: %d", self.name, self.child_pid)
|
||||
_, status = os.waitpid(self.child_pid, 0)
|
||||
if status > 0:
|
||||
job = Job.load(self.manager, job_id)
|
||||
if not job.is_finished():
|
||||
logging.info("[%s] process interrupted and job %s hasn't finished; registering interruption in job",
|
||||
self.name, job_id)
|
||||
job.done(None, "Interrupted/Cancelled while running.")
|
||||
|
||||
logging.info("[%s] Finished Processing %s (pid: %d status: %d)",
|
||||
self.name, job_id, self.child_pid, status)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user