Skip to content

Fix stale lane priority class when reconfiguring lanes - #454

Open
sebxt wants to merge 1 commit into
ValveSoftware:masterfrom
sebxt:fix/lanes-reconfigure-stale-priority-class
Open

sebxt wants to merge 1 commit into
ValveSoftware:masterfrom
sebxt:fix/lanes-reconfigure-stale-priority-class

Conversation

@sebxt

@sebxt sebxt commented Oct 20, 2026

Copy link
Copy Markdown

SNP_ConfigureLanes assigns m_idxPriorityClass inside a loop that starts at the second sorted entry. The lane that sorts first (lowest priority value) is never assigned, so on a reconfiguration it keeps its class index from the previous call. The lanes then get scheduled with the wrong priority. If the old index is no longer valid, it indexes past the end of m_vecPriorityClasses.

This change assigns class 0 to the first sorted lane before the merge loop.

Added Test_lane_quick_reconfigure to suite-quick. It configures two lanes with priorities { 0, 1 }, swaps them to { 1, 0 }, queues equal data on both, and checks the per lane queue time estimates from GetConnectionRealTimeStatus. Before the fix, both lanes report 1000 ms. After the fix, lane 1 reports 500 ms and lane 0 reports 1000 ms, as expected.

Testing: test_crypto and test_connection suite-quick pass on macOS (Homebrew deps, RelWithDebInfo).

Fixes #453

Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
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.

ConfigureConnectionLanes: reconfiguring lanes can leave one lane in a stale priority class

1 participant