Skip to content

Use PID as LocalExecutor job_id; add stateless process-group cancel - #6

Merged
krokicki merged 3 commits into
mainfrom
pid-as-job-id
Jul 28, 2026
Merged

krokicki merged 3 commits into
mainfrom
pid-as-job-id

Conversation

@krokicki

@krokicki krokicki commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Spawn local jobs with start_new_session=True and use the subprocess PID (== its process-group id) as the job_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.
  • Default log files are renamed token->PID after spawn so stdout.{job_id}.log still resolves; array jobs keep a non-numeric array-N id so they're never mistaken for a process-group id.
  • Adds design spec and implementation plan docs for follow-on job dependency chaining work.

Test plan

  • pixi run test — 164 passed

@StephanPreibisch

krokicki and others added 3 commits July 24, 2026 08:49
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>
@krokicki krokicki mentioned this pull request Jul 27, 2026
4 tasks done
@krokicki
krokicki merged commit c1859b4 into main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant