Repository navigation
Use PID as LocalExecutor job_id; add stateless process-group cancel - #6
Merged
Merged
Conversation
Spawn local jobs with start_new_session=True and use the subprocess PID
(== its process-group id) as the job_id. This makes the id a durable OS
handle: a fresh executor in a later process can cancel a job it never
submitted by killing the group by PID (SIGTERM -> grace -> SIGKILL),
without an in-memory _processes entry. cancel() raises if anything
outlives SIGKILL so callers can withhold a "killed" status until
termination is confirmed.
Default log files are renamed token->PID after spawn so the documented
stdout.{job_id}.log still resolves. Array jobs keep a non-numeric id
(array-N) so they can never be mistaken for a process-group id by the
stateless path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 tasks done
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.
Summary
start_new_session=Trueand use the subprocess PID (== its process-group id) as thejob_id, making it a durable OS handle a fresh executor can cancel without an in-memory record.cancel()now kills the process group by PID (SIGTERM -> grace -> SIGKILL) and raises if anything outlives SIGKILL, so callers can withhold a "killed" status until termination is confirmed.stdout.{job_id}.logstill resolves; array jobs keep a non-numericarray-Nid so they're never mistaken for a process-group id.Test plan
pixi run test— 164 passed@StephanPreibisch