Skip to content

[fix] Cancel a publish that waits for the hash threads - #802

Merged
ok merged 1 commit into
mainfrom
fix-cancelled-publish-recorded-shared
Nov 23, 2026
Merged

ok merged 1 commit into
mainfrom
fix-cancelled-publish-recorded-shared

Conversation

@ok

@ok ok commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Since #793 hash passes take turns on the two hash threads. A publish cancelled while it waited for its turn did not stop until the file ahead of it was hashed to its end: the cancel hung behind a large file, and a file cancelled after that could finish and be recorded as shared.

A waiting pass now reads its cancel signal and ends as cancelled without waiting for the pass ahead.

This is also the cause of the flow (3, pipe) failures in test/flow/loose-queued-visible-to-member.test.js ("and the cancelled long hashes are not either"). The flow test is unchanged.

Tests

  • New REGRESSION (FIX-HASH-TURN-CANCEL) in test/integration/prepare-hash-threads.test.js: timed out before the fix, passes after.
  • The flow test failed 1 run in 6 locally without the fix and passed 16 of 16 with it.

No changelog entry: #793 is unreleased.

Hash passes take turns on the threads, and a cancelled publish still
waiting for its turn stayed until the file ahead was hashed to its
end. It now ends at once, so a cancel no longer hangs behind a large
file and a holder cancelled late is not recorded as shared.
@ok
ok merged commit e03cf73 into main Nov 23, 2026
15 checks passed
@ok
ok deleted the fix-cancelled-publish-recorded-shared branch November 24, 2026 08:01
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