def start(self): """Starts the workers main loop.""" self.on_start() self._state = self.RUN if self.pidfile: self.pidlock = platforms.create_pidlock(self.pidfile) try: for i, component in enumerate(self.components): logger.debug('Starting %s...', qualname(component)) self._running = i + 1 if component: component.start() logger.debug('%s OK!', qualname(component)) except SystemTerminate: self.terminate() except Exception as exc: logger.error('Unrecoverable error: %r', exc, exc_info=True) self.stop() except (KeyboardInterrupt, SystemExit): self.stop() try: # Will only get here if running green, # makes sure all greenthreads have exited. self._shutdown_complete.wait() except IGNORE_ERRORS: pass
def start(self): """Starts the workers main loop.""" try: self.blueprint.start(self) except WorkerTerminate: self.terminate() except Exception as exc: logger.error('Unrecoverable error: %r', exc, exc_info=True) self.stop() except (KeyboardInterrupt, SystemExit): self.stop()
def start(self): """Starts the workers main loop.""" try: self.blueprint.start(self) except SystemTerminate: self.terminate() except Exception as exc: logger.error('Unrecoverable error: %r', exc, exc_info=True) self.stop() except (KeyboardInterrupt, SystemExit): self.stop()
def start(self): """Starts the workers main loop.""" try: self.namespace.start(self) except SystemTerminate: self.terminate() except Exception as exc: logger.error("Unrecoverable error: %r", exc, exc_info=True) self.stop() except (KeyboardInterrupt, SystemExit): self.stop()
def start(self): """Starts the workers main loop.""" try: self.blueprint.start(self) except WorkerTerminate: self.terminate() except Exception as exc: logger.error('Unrecoverable error: %r', exc, exc_info=True) self.stop(exitcode=EX_FAILURE) except SystemExit as exc: self.stop(exitcode=exc.code) except KeyboardInterrupt: self.stop(exitcode=EX_FAILURE)
def on_timer_error(self, exc): logger.error('Timer error: %r', exc, exc_info=True)