Fix UdpRssiPack startup race in negotiated RX buffer setup#1135
Merged
Conversation
…ssiPack - Introduced threading to manage RX buffer updates on the server side. - Added methods to apply negotiated RX buffer count and arm server RX buffer updates. - Improved handling of RX buffer configuration to prevent deadlocks during negotiation. - Updated _start and _stop methods to reflect new RX buffer management logic.
ruck314
approved these changes
Mar 16, 2026
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## pre-release #1135 +/- ##
=============================================
Coverage 29.54% 29.55%
=============================================
Files 65 68 +3
Lines 6644 6964 +320
Branches 1015 973 -42
=============================================
+ Hits 1963 2058 +95
- Misses 4527 4753 +226
+ Partials 154 153 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Description
This branch replaces the fixed startup delay in
pyrogue.protocols.UdpRssiPackwith an explicit readiness-based flow for programming the UDP RX buffer count.The underlying issue is that RSSI parameter negotiation completes asynchronously, and only the client side was waiting for link-open before using
curMaxBuffers(). That meant the server side could read and apply the pre-negotiation buffer depth too early. The oldtime.sleep(0.25)masked this race, but it did not actually solve it.What changed:
wait=Trueand client mode,_start()waits for RSSI open before applying negotiated RX buffer depth_start()no longer tries to apply negotiated RX buffer depth immediatelysetRxBufferCount(curMaxBuffers())call until RSSI actually reaches open stateWhy:
curMaxBuffers()is only stable after RSSI negotiation_start()until open can deadlock when both endpoints are managed under the same RootResult: