Exemple #1
0
 def connectionLost(self, reason):
    try:
       log.msg("Connection to node controller lost.")
       WampWebSocketServerProtocol.connectionLost(self, reason)
    except:
       pass
    finally:
       ## loosing the connection to the node controller (the pipes) is fatal.
       ## stop the reactor and exit with error
       if reactor.running:
          reactor.addSystemEventTrigger('after', 'shutdown', os._exit, 1)
          reactor.stop()
       else:
          sys.exit(1)
Exemple #2
0
 def connectionLost(self, reason):
     try:
         # this log message is unlikely to reach the controller (unless
         # only stdin/stdout pipes were lost, but not stderr)
         log.msg("Connection to node controller lost.")
         WampWebSocketServerProtocol.connectionLost(self, reason)
     except:
         pass
     finally:
         # loosing the connection to the node controller is fatal:
         # stop the reactor and exit with error
         if reactor.running:
             reactor.addSystemEventTrigger('after', 'shutdown', os._exit, 1)
             reactor.stop()
 def connectionLost(self, reason):
     try:
         # this log message is unlikely to reach the controller (unless
         # only stdin/stdout pipes were lost, but not stderr)
         log.msg("Connection to node controller lost.")
         WampWebSocketServerProtocol.connectionLost(self, reason)
     except:
         pass
     finally:
         # loosing the connection to the node controller is fatal:
         # stop the reactor and exit with error
         if reactor.running:
             reactor.addSystemEventTrigger('after', 'shutdown', os._exit, 1)
             reactor.stop()
Exemple #4
0
        def connectionLost(self, reason):
            # the behavior here differs slightly whether we're shutting down orderly
            # or shutting down because of "issues"
            if isinstance(reason.value, ConnectionDone):
                was_clean = True
            else:
                was_clean = False

            try:
                # this log message is unlikely to reach the controller (unless
                # only stdin/stdout pipes were lost, but not stderr)
                if was_clean:
                    log.info("Connection to node controller closed cleanly")
                else:
                    log.warn("Connection to node controller lost: {reason}",
                             reason=reason)

                # give the WAMP transport a change to do it's thing
                WampWebSocketServerProtocol.connectionLost(self, reason)
            except:
                # we're in the process of shutting down .. so ignore ..
                pass
            finally:
                # after the connection to the node controller is gone,
                # the worker is "orphane", and should exit

                # determine process exit code
                if was_clean:
                    exit_code = 0
                else:
                    exit_code = 1

                # exit the whole worker process when the reactor has stopped
                reactor.addSystemEventTrigger('after', 'shutdown', os._exit,
                                              exit_code)

                # stop the reactor
                try:
                    reactor.stop()
                except ReactorNotRunning:
                    pass
Exemple #5
0
        def connectionLost(self, reason):
            # the behavior here differs slightly whether we're shutting down orderly
            # or shutting down because of "issues"
            if isinstance(reason.value, ConnectionDone):
                was_clean = True
            else:
                was_clean = False

            try:
                # this log message is unlikely to reach the controller (unless
                # only stdin/stdout pipes were lost, but not stderr)
                if was_clean:
                    log.info("Connection to node controller closed cleanly")
                else:
                    log.warn("Connection to node controller lost: {reason}", reason=reason)

                # give the WAMP transport a change to do it's thing
                WampWebSocketServerProtocol.connectionLost(self, reason)
            except:
                # we're in the process of shutting down .. so ignore ..
                pass
            finally:
                # after the connection to the node controller is gone,
                # the worker is "orphane", and should exit

                # determine process exit code
                if was_clean:
                    exit_code = 0
                else:
                    exit_code = 1

                # exit the whole worker process when the reactor has stopped
                reactor.addSystemEventTrigger('after', 'shutdown', os._exit, exit_code)

                # stop the reactor
                try:
                    reactor.stop()
                except ReactorNotRunning:
                    pass
Exemple #6
0
 def connectionLost(self, reason):
     WampWebSocketServerProtocol.connectionLost(self, reason)
     self.factory.connectionLost(reason)
Exemple #7
0
 def connectionLost(self, reason):
     WampWebSocketServerProtocol.connectionLost(self, reason)
     self.factory.connectionLost(reason)