Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure reaper threads respawn in forks
This broke in 3e2e8ee where it switched to one reaper thread per process. However, the implementation will only spawn the reaping thread if the reaping frequency has not been seen. Since the reaping frequencies are stored in a class instance variable, that variable is copied when the process is forked. As such, a forked process will not spawn a new reaping thread since the class instance variable would have contain the reaping frequency that was seen in the parent process. This commit tracks threads separately and checks that they both have been spawned and are currently alive. This adds a failing test to reaper_test.rb, based on the previous test without forking. It also improves the test to return an failure instead of hanging forever if the reaper is not started. Co-authored-by: Guo Xiang Tan <tgx_world@hotmail.com>
- Loading branch information
Showing
2 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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