-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context #509
Conversation
swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have UTs for ycabled?
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
Please wait for @prgeor's signoff before merging.
…ng swsscommon table within the context (sonic-net#509) * [ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * fix UT Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add more tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * typo Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add port Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add logging Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> --------- Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
…ng swsscommon table within the context (sonic-net#509) * [ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * fix UT Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add more tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * typo Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add port Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add logging Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> --------- Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
…ng swsscommon table within the context (sonic-net#509) * [ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * fix UT Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add more tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * typo Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add port Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add logging Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> --------- Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
Cherry-pick PR to 202311: #516 |
Cherry-pick PR to 202305: #517 |
Cherry-pick PR to 202405: #518 |
…ng swsscommon table within the context (#509) * [ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * fix UT Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add more tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * typo Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add port Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add logging Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> --------- Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
…ng swsscommon table within the context (#509) * [ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * fix UT Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add more tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * typo Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add port Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add logging Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> --------- Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
…ng swsscommon table within the context (#509) * [ycabled][active-active] Fix in gRPC channel callback logic by creating swsscommon table within the context Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * fix UT Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add more tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * typo Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add port Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add logging Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> * add tests Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com> --------- Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
This PR Introduces a an initialization mechanism within the wait_for_state_change function to ensure that the YcableChannelStateTableHelper instance is created only once per port.
Also it Adds a check using hasattr to see if table_helper is already an attribute of wait_for_state_change.
YcableChannelStateTableHelper instances are keyed by port.
This helps ensure that channel object will have a seperate instance of swsscommon table and they will not interfere with normal functioning of state specific threads.
Description
MSFT ADO
Motivation and Context
How Has This Been Tested?
UTs and deploying changes on Libra Testbeds as well as pilot devices
This script was used to test and after each run the output was matched to be as expected.
The fwd_state table is continuously written when link goes down and comes up
unknown
andactive
respectively.example output for one iteration
we can also check in syslog how the grpc connectivity state change syslog is posted with each link/up down
Additional Information (Optional)
another way to check thread function is correct is through logging, as seen fwd table is created in different threads