Repository navigation
Conversation
Malt spawns workers detached, so they don't receive the signals sent to the process group of a cancelled CI job, and a worker busy running a test doesn't notice the manager is gone. Ask the OS to kill the workers when the manager dies (parent-death signal on Linux and FreeBSD, a kill-on-close job object on Windows), and on exit, e.g. on SIGTERM, stop all remaining workers at once instead of one at a time with long timeouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkNLbZCkdtRSrsVx1XJQNr
giordano
commented
Oct 11, 2026
| exits. Returns whether this was successful. | ||
| """ | ||
| function arm_manager_death!(manager_pid::Integer) | ||
| @static if Sys.islinux() || Sys.isfreebsd() |
Collaborator
Author
There was a problem hiding this comment.
Reminder to self: test this PR on FreeBSD
Calling the Windows API with `@ccall`, which always uses the C calling convention, corrupts the stack on 32-bit Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkNLbZCkdtRSrsVx1XJQNr
The Windows API uses the stdcall calling convention on 32-bit Windows, so call it with `ccall` rather than `@ccall`, and drop the restriction to 64-bit. On Windows `kill` always terminates the process abruptly, also with SIGTERM, so without the job object the workers were left running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NkNLbZCkdtRSrsVx1XJQNr
This branch has not been deployed
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.
Haven't looked too closely at the implementation (so I'm opening as draft for the time being, but I want to save the progress) and it seems a bit too overcomplicated for my taste (but perhaps there isn't much to do about it), but the problem I'm trying to solve is to make sure workers are terminated when the driver process receives a SIGTERM or SIGKILL signal (for example when a CI job is cancelled): currently the workers may remain alive, because they don't receive the signal, if they're busy running the tests they keep going.