Skip to content

job: Do not allow adding new jobs after stopping#76

Merged
joamaki merged 1 commit into
mainfrom
pr/joamaki/disallow-adding-jobs-after-stopping
Jun 1, 2026
Merged

job: Do not allow adding new jobs after stopping#76
joamaki merged 1 commit into
mainfrom
pr/joamaki/disallow-adding-jobs-after-stopping

Conversation

@joamaki

@joamaki joamaki commented May 28, 2026

Copy link
Copy Markdown
Contributor

jobLifecycle allowed adding and starting a job after stop() was called. A job that adds another job at runtime and races with stop() may cause a job to start after stop() finishes.

Fix this by adding a stopped bool to jobLifecycle and checking that before trying to add and start a job.

Fixes: ba9edde ("job: Support removing jobs from runtime lifecycle")

jobLifecycle allowed adding and starting a job after stop() was called.
A job that adds another job at runtime and races with stop() may cause
a job to start after stop() finishes.

Fix this by adding a stopped bool to jobLifecycle and checking that
before trying to add and start a job.

Fixes: ba9edde ("job: Support removing jobs from runtime lifecycle")
Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki requested a review from a team as a code owner May 28, 2026 14:18
@joamaki joamaki requested review from bimmlerd and removed request for a team May 28, 2026 14:18
@joamaki joamaki enabled auto-merge (rebase) May 29, 2026 10:27
@joamaki joamaki merged commit a0f33ee into main Jun 1, 2026
1 check passed
@joamaki joamaki deleted the pr/joamaki/disallow-adding-jobs-after-stopping branch June 1, 2026 14:10
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.

2 participants