Skip to content

fix(broadcast): release the channel lock before dropping a payload on overflow - #432

Merged
tisonkun merged 1 commit into
apache:mainfrom
tisonkun:codex/broadcast-overflow-drop
Nov 18, 2026
Merged

tisonkun merged 1 commit into
apache:mainfrom
tisonkun:codex/broadcast-overflow-drop

Conversation

@tisonkun

Copy link
Copy Markdown
Member

Summary

  • Keep the payload with the sender until the broadcast backlog has advanced its version. If the counter overflows, unwinding releases the channel lock before the payload destructor runs.
  • Cover bounded and unbounded publication with and without subscribers. A destructor uses a nonblocking lock acquisition to read the backlog, allowing the regression tests to report a locked channel without hanging.
  • Check that a full bounded channel at the final version still returns the unsent value.

Both destructor regression tests failed on the previous implementation and passed with the fix.

Keep ownership of the payload in the sender until the backlog advances its version. Destructors can then inspect the same channel during unwinding. Exercise both channel types with and without subscribers, and keep full-channel rejection ahead of the version check.
@tisonkun
tisonkun merged commit 0057ad4 into apache:main Nov 18, 2026
9 checks passed
@tisonkun
tisonkun deleted the codex/broadcast-overflow-drop branch November 18, 2026 13:17
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