Improve the way GAP terminates subprocesses to avoid a race condition that could lead to unwanted warnings or even hangs #5804
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 might help with oscar-system/Oscar.jl#4136 where we the
singular
GAP package is loaded, and when GAP exits, an AtExit function is run which ends up invokingCloseStream
and thusCLOSE_PTY_IOSTREAM
-- and we end up closing the file descriptor to the child process before the child properly terminated.It seems logical to me to call
kill
,waitpid
,close
in that order, which this PR implements. Before we didkill
,close
,waitpid
.Note that I have not yet confirmed this actually fixes the issue (and that issue is not always reproducible, and apparently not at all on macOS, just on Linux... Ah well)