Skip to content

Commit 2cf8b6a

Browse files
author
cod1k
committed
FIX: exception handling while spawning fcgi-program which address already bound to another process
1 parent 8d697b3 commit 2cf8b6a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

supervisor/process.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,14 @@ def spawn(self):
739739
"""
740740
Overrides Subprocess.spawn() so we can hook in before it happens
741741
"""
742-
self.before_spawn()
742+
try:
743+
self.before_spawn()
744+
except BaseException as e:
745+
self.record_spawnerr('Could not create FastCGI socket %s: %s' % (
746+
self.group.socket_manager.config(), e))
747+
self.change_state(ProcessStates.BACKOFF)
748+
self.give_up()
749+
return
743750
pid = Subprocess.spawn(self)
744751
if pid is None:
745752
#Remove object reference to decrement the reference count on error

0 commit comments

Comments
 (0)