Skip to content

Add JobStuckHandler callback#1291

Open
brandur wants to merge 1 commit into
masterfrom
brandur-stuck-job-handler
Open

Add JobStuckHandler callback#1291
brandur wants to merge 1 commit into
masterfrom
brandur-stuck-job-handler

Conversation

@brandur

@brandur brandur commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Here, add a JobStuckHandler callback that's invoked when a producer
consider a job to be "stuck". i.e. Passed its timeout, cancellation
attempted, but job didn't respond to cancellation.

The callback includes some basic information about the job that became
stuck, along with the total number of stuck jobs. A result will
optionally open a new executor slot to replace the one taken up by the
stuck job so that a producer that continues to be run doesn't get
completed starved by stuck jobs. The idea here is that clients can
configure themselves to open new slots up to a certain point, but then
may want to restart themselves if there's enough jobs stuck that they
could become a memory liability.

@brandur

brandur commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 098d829c68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Here, add a `JobStuckHandler` callback that's invoked when a producer
consider a job to be "stuck". i.e. Passed its timeout, cancellation
attempted, but job didn't respond to cancellation.

The callback includes some basic information about the job that became
stuck, along with the total number of stuck jobs. A result will
optionally open a new executor slot to replace the one taken up by the
stuck job so that a producer that continues to be run doesn't get
completed starved by stuck jobs. The idea here is that clients can
configure themselves to open new slots up to a certain point, but then
may want to restart themselves if there's enough jobs stuck that they
could become a memory liability.
@brandur brandur force-pushed the brandur-stuck-job-handler branch from 098d829 to 93b3691 Compare June 20, 2026 03:41
@brandur brandur requested a review from bgentry June 20, 2026 03:46
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