WIP: SidekiqMiddleware::Shutdown subprocess killer
We sometimes initiate a sidekiq shutdown due to excessive memory usage or gitaly unavailability. Unlike when using
^C to shutdown Sidekiq this sometimes results in processes being left running instead of properly terminating them.
Kills direct subprocesses during shutdown.
sys-proctable to retrieve cross-platform process information and uses
pgid to find subprocesses in the same process group. These are then sent a
SIGTERM just before we force kill the main Sidekiq process.
Steps to reproduce
See #40396 (comment 72179341) where I've also uploaded a video in case we need to manually reverify this or implement more complicated subprocess killing in the future.
- Changelog entry added, if necessary
- Documentation created/updated
- Tests added for this feature/bug
- Has been reviewed by Backend
Closes #40396 (closed)