Esempio n. 1
0
 def _process_task(self, req):
     """Process task by sending it to the pool of workers."""
     try:
         req.execute_using_pool(self.pool)
     except TaskRevokedError:
         try:
             self._quick_release()  # Issue 877
         except AttributeError:
             pass
     except Exception as exc:
         logger.critical("Internal error: %r\n%s", exc, traceback.format_exc(), exc_info=True)
Esempio n. 2
0
 def start(self):
     try:
         self.blueprint.start(self)
     except WorkerTerminate:
         self.terminate()
     except Exception as exc:
         logger.critical('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)
Esempio n. 3
0
 def _process_task(self, req):
     """Process task by sending it to the pool of workers."""
     try:
         req.execute_using_pool(self.pool)
     except TaskRevokedError:
         try:
             self._quick_release()   # Issue 877
         except AttributeError:
             pass
     except Exception as exc:
         logger.critical('Internal error: %r\n%s',
                         exc, traceback.format_exc(), exc_info=True)
Esempio n. 4
0
 def start(self):
     try:
         self.blueprint.start(self)
     except WorkerTerminate:
         self.terminate()
     except Exception as exc:
         logger.critical('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)
Esempio n. 5
0
 def start(self):
     _start = functools.partial(self.blueprint.start, self)
     try:
         retry_over_time(_start, amqp_exceptions.NotFound, errback=self.on_error)
     except WorkerTerminate:
         self.terminate()
     except Exception as exc:
         logger.critical('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)