Skip to content

fix: account for cancelled queued backfill batches - #722

Open
ke7haav wants to merge 2 commits into
stellar:mainfrom
ke7haav:fix-721-backfill-cancellation
Open

fix: account for cancelled queued backfill batches#722
ke7haav wants to merge 2 commits into
stellar:mainfrom
ke7haav:fix-721-backfill-cancellation

Conversation

@ke7haav

@ke7haav ke7haav commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #721.

Pond can cancel queued task-group work without invoking the submitted closure. Those batches previously retained zero-value BackfillResult entries, making unattempted ledger ranges appear successful.

Changes

  • Initialize every result with its real batch and an explicit not-started error.
  • Preserve the Pond task-group cancellation cause on queued, unstarted results.
  • Propagate the task-group wait error after running work and recompression drain.
  • Keep clean signal shutdown behavior for live ingestion only.
  • Add a deterministic concurrency-1 cancellation regression test.

Scope

This PR is focused on #721.

It does not change ordinary processed-batch failure handling tracked by #688 or oldest-ledger cursor publication tracked by #689.

Testing

  • Focused regression and shutdown tests
  • Focused race tests
  • 100-run determinism check
  • make fmt
  • go vet ./...
  • golangci-lint v2.1.2
  • Broad database-free race suite
  • Repository-wide compile checks

The complete database-backed suite could not run locally because PostgreSQL on 127.0.0.1:5432 rejected the repository’s passwordless test DSN.

Copilot AI balanced review requested due to automatic review settings August 31, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes cancellation accounting for queued backfill batches.

Changes:

  • Marks unstarted batches explicitly and preserves cancellation errors.
  • Propagates backfill task-group failures while retaining clean live-ingestion shutdowns.
  • Adds cancellation regression coverage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/services/ingest_test.go Adapts backfill tests to the new error return.
internal/services/ingest_backfill.go Records and propagates cancelled batch states.
internal/services/ingest_backfill_test.go Tests queued cancellation behavior.
internal/ingest/ingest.go Restricts clean cancellation exits to live ingestion.
internal/ingest/ingest_test.go Tests mode-specific shutdown classification.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/services/ingest_backfill_test.go
Copilot AI review requested due to automatic review settings August 31, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

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.

SIGTERM can leave queued backfill batches unrecorded while the one-shot job exits cleanly

2 participants