Skip to content

Commit

Permalink
FIX: exception handling while spawning fcgi-program which address alr…
Browse files Browse the repository at this point in the history
…eady bound to another process
  • Loading branch information
cod1k committed Jan 27, 2023
1 parent 3285628 commit d4f0e6c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion supervisor/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,19 @@ def spawn(self):
"""
Overrides Subprocess.spawn() so we can hook in before it happens
"""
self.before_spawn()
try:
self.before_spawn()
except NotImplementedError:
raise
except BaseException as e:
if hasattr(self, 'group') and hasattr(self.group, 'socket_manager'):
self.record_spawnerr('Could not create FastCGI socket %s: %s' % (
self.group.socket_manager.config(), e))
else:
self.record_spawnerr(e.args[0])
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
Expand Down

0 comments on commit d4f0e6c

Please sign in to comment.