supervisord program improvement: Ensure child processes are terminated on stop/restart - #108
Merged
Merged
Conversation
kavaribes
previously approved these changes
Nov 17, 2025
planv
approved these changes
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 updates the supervisord configuration to ensure services restart reliably.
The Problem
When supervisord stops a service, it defaults to sending the stop signal only to the main parent process.
Any child processes (like a web server, background worker, etc.) would be orphaned, keep running, and hold onto network ports. This caused subsequent restarts to fail with an EADDRINUSE ("address already in use") error.
The Solution
This change adds two flags to the [program:app] configuration:
stopasgroup=true: Tells supervisord to send the stop signal to the entire process group, including all child processes.killasgroup=true: As a fallback, ensures the entire group is killed if the graceful stop fails.This guarantees that all processes are properly terminated, freeing up ports and allowing supervisord to restart services cleanly. This fix is application-agnostic and improves reliability for any service that spawns child processes.
Other Changes
547.0.04.48.2