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.
We use sidekiq enterprise, which has a swarm feature (https://github.com/sidekiq/sidekiq/wiki/Ent-Multi-Process).
It has a master process, which preloads the gems and application and forks child processes. When master preloads the gems, it also loads coverband. Coverband sets
at_exit
hook and a background thread (Coverband::Background
) in the master. But when it forks the child processes, only theat_exit
hook remains in the child, but the background thread is not working anymore (in the dead state).I spent a good amount of time to figure out why we have some coverage missed, even though the code is clearly running in production.
I propose to add a simple integration for sidekiq swarm to make future people lifes easier.
Maybe it is also a good idea to make the solution more generic by somehow identifying when the process was forked and recreate the background thread? 🤔