Cleanup children in prefork mode, annotate NORETURN
to fix implicit fallthrough
#60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR primarily addresses issue #19, although it tackles other issues as well. When the
prefork
option is specified via the command line, the initial process spawns a set number of child processes within a control loop. While there is a provision to reap these child processes upon their exit, the master process currently lacks a mechanism to notify them to terminate when it receives aSIGTERM
orSIGINT
. This behavior can be problematic due to variations in how different init systems and third-party managers handle program management. For example,systemd
in its default configuration sendsSIGTERM
signals to all processes in the control group. However, this is not universally true; Docker, for instance, sends aSIGTERM
only to the process specified in theENTRYPOINT
instruction.Key Fixes and Improvements:
NORETURN
annotation as a cleaner solution. This change was necessary for successful compilation.SIGTERM
signals to all processes in the process group upon its exit, thereby ensuring graceful termination.I'm up and running with these patches but have not tested this extensively. If maintainers consider merging this, I will follow up. I welcome community feedback.