Skip to content

Remove WaitActive state during negotiation #1722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: mkeeter/add-disabled-state
Choose a base branch
from

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented May 22, 2025

Staged on top of #1721

The WaitActive state has outlived its usefulness.

Right now, there are two wait points in the Upstair's client task:

  • It waits for a oneshot (client_connect_tx/rx) to be fired before connecting to the Downstairs
  • After receiving YesItsMe from the downstairs, it waits for the upstairs to be activated before sending PromoteToActive. This is implemented through a runtime check when it reaches the WaitForActive state

It turns out that these two things always happen together; there's no case where we want to connect to a Downstairs, get to YesItsMe, then not promote it to active.

This PR removes the WaitActive state, moving straight from Start to WaitForPromote once the connection oneshot fires. I believe this fixes the (hypothetical) panic proposed in #1721, although I haven't written out a unit test for it.

Most of the LOC changes are removing the increasingly-outdated block comment about negotiation; it's all nicely represented the NegotiationState docstring, which has been kept up to date.

@mkeeter mkeeter requested review from jmpesp and leftwo May 22, 2025 18:33
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