[Link Event Damping] Add SelectablesTracker for timer management#1798
Open
DendroLabs wants to merge 2 commits intosonic-net:masterfrom
Open
[Link Event Damping] Add SelectablesTracker for timer management#1798DendroLabs wants to merge 2 commits intosonic-net:masterfrom
DendroLabs wants to merge 2 commits intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…king Supersedes PR sonic-net#1323 by @Ashish1805. Adds SelectablesTracker class that tracks Selectable objects and their corresponding EventHandler mappings, used by the link event damper feature. Changes from original PR addressing review feedback: - Move non-copyable/non-movable declarations to private section (@kcudnik) - Replace raw pointers with shared_ptr for EventHandler to prevent memory leaks, consistent with syncd project conventions (@kcudnik) - Reorder null checks: check eventHandler before accessing selectable fd (@Junchao-Mellanox) - Add empty line before if() for consistent formatting (@kcudnik) Signed-off-by: DendroLabs <info@dendrolabs.com>
- Add std::mutex thread synchronization to all public methods - Add missing mock methods (selectableIsTracked, getEventHandlerForSelectable) - Fix test use-after-free by adding TearDown cleanup - Add const qualifiers to read-only methods Signed-off-by: DendroLabs <info@dendrolabs.com>
1f19657 to
dacab2c
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
/easycla |
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.
Summary
Supersedes #1323 by @Ashish1805. Adds the
SelectablesTrackerclass for tracking selectable timers used by the link event damper in syncd.This is part of the Link Event Damping feature (HLD: sonic-net/SONiC#1071).
All review feedback from #1323 has been addressed:
private(@kcudnik)shared_ptrfor memory safety (@kcudnik)getFd()call (@Junchao-Mellanox)if()blocks (@kcudnik)constexprfix already present on masterChanges:
syncd/SelectablesTracker.h-- Header with private members, shared_ptr interfacesyncd/SelectablesTracker.cpp-- Implementation with proper null checking orderunittest/syncd/TestSelectablesTracker.cpp-- 11 unit test casesunittest/syncd/MockSelectablesTracker.h-- Mock class in separate filesyncd/Makefile.amandunittest/syncd/Makefile.amDependency chain: This PR is a prerequisite for the per-port link event damper (#1334) and the libsai RedisInterface (#1331).
Test plan
🤖 Generated with Claude Code
Co-Authored-By: Ashish Singh ashish.singh@google.com