Skip to content

Avoid sending duplicate channel.open - #114

Merged
michalovits merged 2 commits into
bloomberg:mainfrom
michalovits:double-channel-opens
Nov 12, 2026
Merged

michalovits merged 2 commits into
bloomberg:mainfrom
michalovits:double-channel-opens

Conversation

@michalovits

Copy link
Copy Markdown
Contributor

Make sure we don't send channel.open twice. Here is an example race:

  • Receive channel.close, transition to CLOSED
  • Complete some other write, schedule channel reopen; we're still CLOSED
  • Complete the channel.close-ok write, schedule channel reopen
  • We send out two opens

More generally:

  • Do not open the channel if we're already in an open, opening, or closing state
  • Do not reopen the channel if we've moved on from the lifetime we were trying to reopen
  • Only schedule a reopen after we've written the close-ok -- see the race above, we were doing it too soon.

Signed-off-by: Stavros Michalovits <stmichalovits@gmail.com>
Signed-off-by: Stavros Michalovits <stmichalovits@gmail.com>
@michalovits
michalovits marked this pull request as ready for review November 12, 2026 09:16
@michalovits
michalovits requested a review from a team November 12, 2026 09:16
@michalovits
michalovits merged commit 1cb0f8a into bloomberg:main Nov 12, 2026
4 checks passed
@michalovits
michalovits deleted the double-channel-opens branch November 12, 2026 11:14
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.

2 participants