Skip to content

fix(persistence): fail a bulk-submit manifest even when its error artifact cannot be written - #3363

Open
angela-helios wants to merge 2 commits into
mainfrom
fix/3084-bulk-submit-attempt-cap-artifact
Open

angela-helios wants to merge 2 commits into
mainfrom
fix/3084-bulk-submit-attempt-cap-artifact

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Closes #3084

Behaviour change to review

A bulk-submit manifest that fails before ingest (its manifest cannot be fetched, or it is past its attempt cap) is now marked failed even when its error artifact cannot be written to the output store. In that case the manifest has its error_message but no error output file, and the worker logs a warning. Before, the manifest stayed processing and was claimed again each time its lease lapsed.

Summary

  • fail_before_ingest treats the manifest-level error artifact as best effort. If write_manifest_error fails, it logs a warn and publishes the terminal Failed state with no artifact, instead of returning the error and leaving the manifest processing.
  • The over-cap branch reports the configured cap (max_attempts) in the abandoned message and log, rather than lease.attempt - 1, so the message no longer grows with later claims.
  • The fetch-error path shares fail_before_ingest and gets the same behaviour.
  • A storage error while publishing the terminal state still propagates, as before.

Tests

Two unit tests in crates/persistence/src/core/bulk_submit_worker.rs (SQLite job store, a fault-injecting output store):

  • test_a_manifest_past_its_attempt_cap_fails_when_its_error_artifact_cannot_be_written: cap of 2, three lapsed claims, then a run on attempt 4 with an output store that refuses to open the part, and again with one whose writes fail. Asserts the manifest is failed, no file is published, the message is "manifest abandoned after 2 attempts", and the manifest is not claimable again.
  • test_a_fetch_error_fails_the_manifest_when_its_error_artifact_cannot_be_written: the same output-store failure on the fetch-error path.

Results:

  • cargo test -p helios-persistence --lib --features s3 -- bulk_submit_worker backends::s3 bulk_export_worker: 406 passed. That includes the two new tests.
  • I did not run the whole persistence library suite or clippy locally; CI runs them.

The HFS_BULK_SUBMIT_MAX_ATTEMPTS rows in crates/rest/README.md and the bulk-data-submit skill (both mirrors) now say the error artifact is written when the output store accepts it.

These ran on a branch that also carried other pending fixes, so the suites were verified in combination, not on this branch alone.

…ifact cannot be written

A manifest past its attempt cap, or one whose manifest could not be
fetched, was failed only after its error artifact reached the output
store. When that write failed the manifest stayed processing and was
claimed again on every lease lapse, without limit.

The error artifact is now best effort: a write failure is logged and the
manifest is published as failed with no artifact. The abandoned message
reports the configured cap instead of the claim count.

Closes #3084
@claude

claude Bot commented Dec 1, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This branch has not been deployed

No deployments
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.

Bulk-submit: a manifest past its attempt cap is re-claimed forever when its error artifact cannot be written

1 participant