diff --git a/rq/worker.py b/rq/worker.py index 13407e3..d1531a3 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -675,10 +675,13 @@ class Worker(object): self._is_horse = True self.log = logger self.perform_job(job, queue) - finally: - # os._exit() is the way to exit from childs after a fork(), in - # constrast to the regular sys.exit() - os._exit(0) + except: # noqa + # Horse does not terminate properly + os._exit(1) + + # os._exit() is the way to exit from childs after a fork(), in + # constrast to the regular sys.exit() + os._exit(0) def setup_work_horse_signals(self): """Setup signal handing for the newly spawned work horse."""