Fixing sonic-buildimage failures due to PR#1906 - #1942
Closed
sivat6 wants to merge 12 commits into
Closed
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
lolyu
reviewed
Jun 17, 2026
lolyu
left a comment
Contributor
There was a problem hiding this comment.
Can you add UT to your change?
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates syncd link event damping handling to avoid sending port state change notifications directly from the damping-sync path, instead queuing them and flushing/sending from the main Syncd::run() loop. This aims to prevent select()-loop instability observed in sonic-buildimage builds and improves robustness of notification delivery timing.
Changes:
- Introduce a mutex-protected pending-notifications queue in
Syncd, withprocessPendingDampingSync()enqueueing and a newflushPendingDampingNotifications()sending from the main thread. - Update the main
Syncd::run()loop to explicitly handleSelect::TIMEOUT/ERROR/SIGNALINTand flush queued damping notifications in a controlled place. - Add/extend unit tests covering enqueueing, overflow behavior, flush behavior, and integrated flow; add required build flags for private-member inspection in syncd unit tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
syncd/Syncd.cpp |
Implements enqueue+flush notification flow and adjusts the main select loop control flow. |
syncd/Syncd.h |
Adds pending notification queue + mutex and declares the new flush method. |
unittest/syncd/TestSyncd.cpp |
Adds unit tests for the new queue/flush behavior and fixes constexpr linkage. |
unittest/syncd/Makefile.am |
Adds -fno-access-control to support tests inspecting internal Syncd state. |
|
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…c-net#1912) What I did Added handling for SAI_OBJECT_TYPE_METER_BUCKET_ENTRY in meta/MetaKeyHasher.cpp: operator== overload for sai_meter_bucket_entry_t comparing (switch_id, eni_id, meter_class). sai_get_hash for the same struct. case in the extension switch of both MetaKeyHasher::operator() (hash) and MetaKeyHasher::operator() (equality). Unit test MetaKeyHasher.operator_eq_meter_bucket_entry in unittest/meta/TestMetaKeyHasher.cpp. Why I did it MetaKeyHasher::operator() / operator== are the hasher/comparator used by the unordered containers keyed by sai_object_meta_key_t inside meta/Meta.cpp (e.g. m_saiObjectCollection). Any meta-key whose object type isn't enumerated in the two switch statements falls through to SWSS_LOG_THROW("not handled: ..."). SAI_OBJECT_TYPE_METER_BUCKET_ENTRY is a DASH extension entry type already supported by sai_serialize_meter_bucket_entry / sai_deserialize_meter_bucket_entry in meta/SaiSerialize.cpp, but it was never added to the hasher. As a result, unit tests Meta.quad_mcast_fdb_entry and Meta.quad_impc_entry started failing with: :- operator(): not handled: SAI_OBJECT_TYPE_METER_BUCKET_ENTRY when the meta layer iterated extension entry metadata while validating create/get/remove on mcast_fdb / ipmc entries. The companion test Meta.remove_meter_bucket_entry passes because its code path does not exercise the hasher branch. How I verified it New unit test MetaKeyHasher.operator_eq_meter_bucket_entry exercises both operator() overloads (hash + equality) with SAI_OBJECT_TYPE_METER_BUCKET_ENTRY keys. Existing meta unit tests Meta.quad_mcast_fdb_entry / Meta.quad_impc_entry should now pass on CI. Details if related Hash is computed from (eni_id, meter_class), matching the pattern used for other extension entries such as SAI_OBJECT_TYPE_ENI_TRUSTED_VNI_ENTRY. switch_id is intentionally not folded into the hash (consistent with other entry hashers) but is included in the equality check. Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
* Adding link event damping support Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Revert "Adding link event damping support" This reverts commit 0953e68. Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding link event damping support Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Addressing review comments Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Wrongly checked !=0 instead of ==0 Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing indentation issues Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fix build errors Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing build error Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing unit test failure Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing white space error and missing SWSS_LOG_ENTER Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing dpkg dependency problems for libswsscommon Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing my changes in build-template.yml file Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing spell check failures Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing the fix added to build-swss-template.yml Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding more test cases to increase coverage Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing the failed UT case Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing the typo in the last commit Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing few test cases Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing similar tests Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing the notification from timer thread to main thread Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Test purpose to see PR# 1925 fixes current build issue Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Remove the code of PR# 1925 Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing build issue Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * SWSS_LOG_ENTER missed in new API Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding suppress and reuse threshold invalid config check Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding tests to increase coverage Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Added SWSS_LOG_ENTER() in the APIs in test file Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Addressed review comments Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Addressed code review comments Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding tests under unittest and removing the unnecessary tests from syncd/tests/TestSyncdLinkEventDamping.cpp Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Trigger pipeline Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding SWSS_LOG_ENTER() Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Debugging the test case Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Tweaking some timing value in one test Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Tweaking params Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> --------- Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
…cd::run() Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Contributor
Author
|
New PR Opened, |
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 of PR
Noticed the following error logs in syncd.
2026 Jun 15 06:51:58.579634 vlab-01 ERR syncd#syncd: :- run: select failed: 2
Summary:
Fixes #
processPendingDampingSync() was directly sending notifications via m_notifications->send() which might affect the fd that select() is managing resulted in inconsistent state.
Introduced a queue with mutex protection. processPendingDampingSync() enqueues the notifications and flushPendingDampingNotifications() dequeues and sends in main thread.
Type of change
Approach
What is the motivation for this PR?
Build issue in sonic-buildimage
Work item tracking
None
How did you do it?
The processPendingDampingSync() just enqueues the notifications. Later flushPendingDampingNotifications() dequeues and sends in main thread.
How did you verify/test it?
Unit Testing done. Without the fix, I can see the run:select_failed messages every 1 sec. After the fix, I am not seeing this error logs.
Any platform specific information?
None
Documentation
None