Skip to content

Mark job FAILED on any uncaught crash, not just interrupts - #98

Merged
koenvo merged 3 commits into
mainfrom
fix/report-failure-on-crash
Oct 28, 2026
Merged

koenvo merged 3 commits into
mainfrom
fix/report-failure-on-crash

Conversation

@koenvo

@koenvo koenvo commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The summary is persisted RUNNING up front so a job is observable from the moment it starts. But execute() only caught KeyboardInterrupt/SystemExit (-> ABORTED); the async submit/collect loop only caught StopProcessing / interrupts / FatalError. An ordinary exception in an uncovered phase — e.g. an HTTP 402 from a source API during submit — propagated uncaught, so the up-front RUNNING summary was never updated and monitoring kept reading the job as "still running" forever.

Add a top-level backstop in execute(): on any other exception, flip a still-RUNNING summary to FAILED (set_exception) and persist it before re-raising. It only acts when the summary is still RUNNING, so richer inner handlers that already recorded partial results are left untouched. Catch Exception (not BaseException) so GeneratorExit/interrupts are unaffected.

The summary is persisted RUNNING up front so a job is observable from the
moment it starts. But execute() only caught KeyboardInterrupt/SystemExit
(-> ABORTED); the async submit/collect loop only caught StopProcessing /
interrupts / FatalError. An ordinary exception in an uncovered phase — e.g.
an HTTP 402 from a source API during submit — propagated uncaught, so the
up-front RUNNING summary was never updated and monitoring kept reading the
job as "still running" forever.

Add a top-level backstop in execute(): on any other exception, flip a
still-RUNNING summary to FAILED (set_exception) and persist it before
re-raising. It only acts when the summary is still RUNNING, so richer inner
handlers that already recorded partial results are left untouched. Catch
Exception (not BaseException) so GeneratorExit/interrupts are unaffected.

Claude-Session: https://claude.ai/code/session_01B5EfLJqoafjW1FhvkxGSmg
Python 3.9 is end-of-life and setup-python no longer provides it on the
GitHub-hosted runners, so those matrix legs fail to start. Test on 3.10–3.12.

Claude-Session: https://claude.ai/code/session_01B5EfLJqoafjW1FhvkxGSmg
SQLAlchemy 2.1 makes psycopg (v3) the default dialect for a plain
`postgresql://` URL (psycopg2 was the default before), so the job failed with
"No module named 'psycopg'" while only psycopg2-binary was installed. Install
both drivers so the job passes whichever SQLAlchemy version resolves.

Claude-Session: https://claude.ai/code/session_01B5EfLJqoafjW1FhvkxGSmg
@koenvo
koenvo merged commit 1828c95 into main Oct 28, 2026
18 of 20 checks passed
@koenvo
koenvo deleted the fix/report-failure-on-crash branch October 28, 2026 21:36
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