Repository navigation
fix(saiserver): guard LAG memberships with a mutex and clear them on reset - #765
Open
mohankarthik wants to merge 1 commit into
Open
mohankarthik wants to merge 1 commit into
mohankarthik wants to merge 1 commit into
Conversation
This was referenced Oct 21, 2026
mohankarthik
force-pushed
the
split/pr4-lag-membership-safety
branch
from
October 22, 2026 04:09
70ed3d1 to
60ff39b
Compare
…reset The lag server's memberships map is mutated from concurrent CreateLagMember/RemoveLagMember gRPC handlers without synchronization, RemoveLagMember never forgets a removed membership, and saiSwitch.Reset (called from SAI re-initialization together with attrmgr.Reset, which restarts OID allocation) never resets the lag server. After a reset, stale memberships keyed by recycled OIDs can make RemoveLagMember detach the wrong port from the wrong LAG. - Add lag.mu and take it in Reset, CreateLagMember and RemoveLagMember. - Claim (delete) the membership under the lock in RemoveLagMember and restore it if the dataplane AggregateDel fails, so the removal can be retried. - Call sw.Lag.Reset() from saiSwitch.Reset(). Adds TestRemoveLagMemberForgetsMembership, TestRemoveLagMemberRetryAfterDataplaneError, TestSwitchResetClearsLagMemberships and TestLagMemberConcurrent (run with -race).
mohankarthik
force-pushed
the
split/pr4-lag-membership-safety
branch
from
October 26, 2026 04:23
60ff39b to
fc8c257
Compare
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.
The lag server's memberships map is mutated from concurrent
CreateLagMember/RemoveLagMember gRPC handlers without synchronization,
RemoveLagMember never forgets a removed membership, and saiSwitch.Reset
(called from SAI re-initialization together with attrmgr.Reset, which
restarts OID allocation) never resets the lag server. After a reset,
stale memberships keyed by recycled OIDs can make RemoveLagMember detach
the wrong port from the wrong LAG.
restore it if the dataplane AggregateDel fails, so the removal can be
retried.
Adds TestRemoveLagMemberForgetsMembership,
TestRemoveLagMemberRetryAfterDataplaneError,
TestSwitchResetClearsLagMemberships and TestLagMemberConcurrent (run
with -race).