Skip to content

fix: mark execution failed when result ingestion fails#740

Merged
lewisjared merged 2 commits into
mainfrom
fix/ingestion-failure-marks-failed
Jun 18, 2026
Merged

fix: mark execution failed when result ingestion fails#740
lewisjared merged 2 commits into
mainfrom
fix/ingestion-failure-marks-failed

Conversation

@lewisjared

Copy link
Copy Markdown
Contributor

Description

When a diagnostic ran successfully but persisting its result bundle failed (malformed CMEC JSON, controlled-vocabulary/schema mismatch, or any DB insert error), handle_execution_result swallowed the exception and then still marked the execution successful and the execution group clean. Because the ingestion runs inside a savepoint that rolls back the metric/series/output inserts, the execution was recorded as successful with zero metric values, and since the group was marked clean the next ref solve never retried it — silent data loss on the framework's core job of producing metric values.

The ingestion except block now marks the execution failed and returns, leaving the group dirty so the next solve retries it. This mirrors the existing system-failure branch in the same function. A new regression test drives a successful diagnostic whose ingestion raises and asserts the execution ends up failed with the group still dirty.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

When a diagnostic ran successfully but persisting its result bundle failed
(malformed CMEC JSON, controlled-vocabulary/schema mismatch, or any DB insert error),
the ingestion exception was swallowed and the execution was still marked successful
and the execution group cleaned.
The savepoint had already rolled back the metric/series/output inserts,
so the execution was recorded as successful with zero metric values,
and because the group was clean the next solve never retried it — silent data loss.

The ingestion except block now marks the execution failed and returns,
leaving the group dirty so the next solve retries it,
mirroring the existing system-failure branch in the same function.
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core 92.55% <100.00%> (+<0.01%) ⬆️
providers 91.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...te-ref/src/climate_ref/executor/result_handling.py 95.23% <100.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lewisjared lewisjared merged commit bdb1b48 into main Jun 18, 2026
27 checks passed
@lewisjared lewisjared deleted the fix/ingestion-failure-marks-failed branch June 18, 2026 11:09
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