Skip to content

fix: recover panics in worker goroutines#258

Merged
stuartwdouglas merged 1 commit intomainfrom
sdouglas/recover-scheduler-panics
Apr 14, 2026
Merged

fix: recover panics in worker goroutines#258
stuartwdouglas merged 1 commit intomainfrom
sdouglas/recover-scheduler-panics

Conversation

@stuartwdouglas
Copy link
Copy Markdown
Contributor

Panics in scheduled jobs (e.g. from metadatadb, logging, or feature flags) would crash the entire process with exit code 2. This wraps job execution in a deferred recover so panics are captured as errors with a stack trace, logged, and the worker stays alive.

@stuartwdouglas stuartwdouglas requested a review from a team as a code owner April 14, 2026 05:00
@stuartwdouglas stuartwdouglas requested review from jrobotham-square and removed request for a team April 14, 2026 05:00
Panics in scheduled jobs (e.g. from metadatadb, logging, or feature
flags) would crash the entire process with exit code 2. Wrap job
execution in a deferred recover so panics are captured as errors with
a stack trace, logged, and the worker stays alive.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d8a56-4eee-7490-8132-1d5bbea7d251
@stuartwdouglas stuartwdouglas force-pushed the sdouglas/recover-scheduler-panics branch from 5bd1962 to 3ef9845 Compare April 14, 2026 05:04
@stuartwdouglas stuartwdouglas changed the title jobscheduler: recover panics in worker goroutines fix: recover panics in worker goroutines Apr 14, 2026
@stuartwdouglas stuartwdouglas merged commit c43a342 into main Apr 14, 2026
10 of 12 checks passed
@stuartwdouglas stuartwdouglas deleted the sdouglas/recover-scheduler-panics branch April 14, 2026 05:44
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