Skip to content

fix(jobscheduler): stop scheduling new jobs on shutdown#365

Merged
alecthomas merged 1 commit into
mainfrom
aat/scheduler-drain-on-shutdown
Jun 26, 2026
Merged

fix(jobscheduler): stop scheduling new jobs on shutdown#365
alecthomas merged 1 commit into
mainfrom
aat/scheduler-drain-on-shutdown

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

The scheduler's context is decoupled from SIGTERM so workers can finish
in-flight jobs during the HTTP drain window, but this meant new jobs and
periodic re-arms kept being scheduled throughout shutdown.

Add a Drain phase that halts new submissions and periodic re-arming as
soon as shutdown begins, while leaving workers running until the context
is cancelled for the final teardown.

The scheduler's context is decoupled from SIGTERM so workers can finish
in-flight jobs during the HTTP drain window, but this meant new jobs and
periodic re-arms kept being scheduled throughout shutdown.

Add a Drain phase that halts new submissions and periodic re-arming as
soon as shutdown begins, while leaving workers running until the context
is cancelled for the final teardown.
@alecthomas alecthomas requested a review from a team as a code owner June 26, 2026 02:49
@alecthomas alecthomas requested review from stuartwdouglas and removed request for a team June 26, 2026 02:49
@alecthomas alecthomas enabled auto-merge (squash) June 26, 2026 02:49
@alecthomas alecthomas merged commit 2c636d7 into main Jun 26, 2026
7 checks passed
@alecthomas alecthomas deleted the aat/scheduler-drain-on-shutdown branch June 26, 2026 02:51
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