Robert Brewer  committed da14d09

Made bus.exit call `os._exit` if called before start completes.

  • Participants
  • Parent commits 97b3df1
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/process/

     def exit(self):
         """Stop all services and prepare to exit the process."""
+        exitstate = self.state
             # can't just let exceptions propagate out unhandled.
             # Assume it's been logged and just die.
             os._exit(70) # EX_SOFTWARE
+        if exitstate == states.STARTING:
+            # exit() was called before start() finished, possibly due to
+            # Ctrl-C because a start listener got stuck. In this case,
+            # we could get stuck in a loop where Ctrl-C never exits the
+            # process, so we just call os.exit here.
+            os._exit(70) # EX_SOFTWARE
     def restart(self):
         """Restart the process (may close connections).