Open
Conversation
Some processes are getting orphaned when running Foreman with JRuby.
Creating a new pgroup allows them all to be killed together.
I believe the issue is related to how JRuby handles `Dir.chdir` by
creating a shell process: `sh -c 'cd /chdir/target; ${command}'`. That
causes a second process to be created that won't get cleaned up by
killing the parent.
kovyrin
reviewed
Nov 1, 2018
| system "sending #{signal} to #{name_for(pid)} at pid #{pid}" | ||
| begin | ||
| Process.kill(signal, pid) | ||
| Process.kill("-#{signal}", pid) |
Author
There was a problem hiding this comment.
This sends the signal to all processes in the group. I still saw leftover processes when the signal was sent only to the parent
This was referenced Jun 26, 2021
baelter
approved these changes
Dec 22, 2021
|
This PR is needed for |
Author
I think there's a new version here: #780 |
|
@davishmcclurg Yes, that was actually the branch I tested with. |
This was referenced Oct 28, 2022
|
I forked foreman and merged #780 (this PR but rebased) and released the fork as |
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.
Some processes are getting orphaned when running Foreman with JRuby.
Creating a new pgroup allows them all to be killed together.
I believe the issue is related to how JRuby handles
Dir.chdirbycreating a shell process:
sh -c 'cd /chdir/target; ${command}'. Thatcauses a second process to be created that won't get cleaned up by
killing the parent.