mgd: swap sync bfd impl out for bfd-async#796
Open
jgallagher wants to merge 1 commit into
Open
Conversation
c9b17e6 to
cee38fc
Compare
taspelund
added a commit
that referenced
this pull request
Jul 7, 2026
The condvar/Mutex<()>/dropped-flag scheme had lost-wakeup races (no predicate under the mutex), which could delay reconciliation or shutdown by a full poll interval, and split shutdown across two Drop impls. Use a sync_channel(1) instead: try_send wakes the monitor (a full buffer coalesces rapid config changes), and the loop exits when the channel disconnects. Drop for UnnumberedManager clears the Option<SyncSender> to disconnect before ManagedThread joins the thread; Drop bodies run before field drops, so the ordering is structural. Disconnected at the wake site can only mean the monitor panicked, so log it at crit. None means a test manager with no monitor thread. An async conversion of this subsystem is planned as a follow-up PR in the style of the BFD conversion (#795/#796). Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is staged on top of #795.
I left the
bfdcrate in place and removed now-dead code. This leaves the repo in a slightly weird state with abfdcrate that exists for packet parsing and some shared types and abfd-asynccrate where all the implementations are, but it minimizes the git diff for easier reviewing. If we land this I can do a followup that merges the two crates.