diff --git a/supervisor/process.py b/supervisor/process.py index b394be812..7db231af9 100644 --- a/supervisor/process.py +++ b/supervisor/process.py @@ -739,7 +739,14 @@ def spawn(self): """ Overrides Subprocess.spawn() so we can hook in before it happens """ - self.before_spawn() + try: + self.before_spawn() + except BaseException as e: + self.record_spawnerr('Could not create FastCGI socket %s: %s' % ( + self.group.socket_manager.config(), e)) + self.change_state(ProcessStates.BACKOFF) + self.give_up() + return pid = Subprocess.spawn(self) if pid is None: #Remove object reference to decrement the reference count on error