Skip to content

Comments

fix(xfer): Prevent no-wait early completion race#1074

Merged
leumor merged 2 commits intorelease/2from
bugfix/bulktransmitter-no-wait-race
Feb 22, 2026
Merged

fix(xfer): Prevent no-wait early completion race#1074
leumor merged 2 commits intorelease/2from
bugfix/bulktransmitter-no-wait-race

Conversation

@leumor
Copy link
Collaborator

@leumor leumor commented Feb 22, 2026

Summary

  • fix a race in BulkTransmitter no-wait completion logic where send() could complete before the transmitter observed a newly received block
  • replace prb.hasWholeFile() early-complete gating with transmitter-local block observation tracking
  • only complete no-wait mode after this transmitter has observed all blocks and has no pending local blocks left to queue
  • add a deterministic regression test that forces the ordering window (hasWholeFile=true before blockReceived() notification) and verifies no premature completion

How To Test

  • ./gradlew test --tests '*BulkTransmitterTest'
  • ./gradlew test --tests '*BulkTransmitterTest.send_whenNewBlockArrivesWithPacketsInFlight_expectOpportunisticSecondSend' --rerun-tasks

Validation Notes

  • stress-ran the previously failing test method 8 times with --rerun-tasks; all runs passed
  • this specifically targets intermittent failures seen during Ubuntu amd64 packaging builds

@sonarqubecloud
Copy link

@leumor leumor merged commit 5e8dc60 into release/2 Feb 22, 2026
4 checks passed
@leumor leumor deleted the bugfix/bulktransmitter-no-wait-race branch February 22, 2026 16:48
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