You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fork example (https://github.com/jonashaag/bjoern/blob/master/tests/fork.py) ignores child processes' exit codes. Whatever happens to the children, the parent process will exit gracefully. This does not allow to run it with supervisord or similar means (which automatically restart crashed processes).
Additionally, the fork example will allow a situation when (on a multi-CPU machine) half of child processes crashed for some reason, the other half is still alive, and the server is thus underperforming (not utilizing all CPU cores).
I personally reworked the end of the file like this:
try:
# Wait for the first worker to exit. They should never exit!# Once first is dead, kill the others and exit with error code.pid, xx=os.wait()
worker_pids.remove(pid)
finally:
forpidinworker_pids:
os.kill(pid, signal.SIGINT)
exit(1)
The text was updated successfully, but these errors were encountered:
The fork example (https://github.com/jonashaag/bjoern/blob/master/tests/fork.py) ignores child processes' exit codes. Whatever happens to the children, the parent process will exit gracefully. This does not allow to run it with supervisord or similar means (which automatically restart crashed processes).
Additionally, the fork example will allow a situation when (on a multi-CPU machine) half of child processes crashed for some reason, the other half is still alive, and the server is thus underperforming (not utilizing all CPU cores).
I personally reworked the end of the file like this:
The text was updated successfully, but these errors were encountered: