Skip to content

fix(cold): track stream producer tasks for graceful shutdown#40

Open
prestwich wants to merge 2 commits intomainfrom
fix/cold-stream-task-tracking
Open

fix(cold): track stream producer tasks for graceful shutdown#40
prestwich wants to merge 2 commits intomainfrom
fix/cold-stream-task-tracking

Conversation

@prestwich
Copy link
Member

Summary

  • Stream producer tasks were spawned via bare tokio::spawn, escaping the task runner's TaskTracker — not awaited during shutdown, not visible to the read/write barrier
  • Add stream_tracker: TaskTracker to ColdStorageTaskInner for long-lived stream producers
  • Streams are tracked for graceful shutdown but intentionally NOT drained before writes (backends provide their own read isolation via MDBX snapshots / PG REPEATABLE READ / anchor-hash detection)
  • Strengthen ColdStorage::produce_log_stream docs to make the concurrency contract explicit

Closes ENG-1988

Test plan

  • cargo clippy -p signet-cold --all-features --all-targets
  • cargo clippy -p signet-cold --no-default-features --all-targets
  • cargo +nightly fmt
  • cargo t -p signet-cold — conformance suite passes

🤖 Generated with Claude Code

prestwich and others added 2 commits March 11, 2026 09:39
Stream producers were spawned via bare `tokio::spawn`, escaping the
task runner's `TaskTracker`. This meant they were not awaited during
graceful shutdown and ran outside the read/write serialization barrier.

Add a separate `stream_tracker` on `ColdStorageTaskInner` for
long-lived stream producers. Streams are tracked for shutdown but not
drained before writes — backends provide their own read isolation
(MDBX snapshots, PostgreSQL REPEATABLE READ, anchor-hash detection).

Strengthen `ColdStorage::produce_log_stream` docs to make the
concurrency contract explicit.

Closes ENG-1988

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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