-
Notifications
You must be signed in to change notification settings - Fork 285
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
[Syncd] make sure syncd can exit gracefully #321
Conversation
yxieca
commented
May 24, 2018
- Stop notification thread before removing switch
- Stop flex counter queries before removing switch
So that we could join() it at shutdown time. Signed-off-by: Ying Xie <ying.xie@microsoft.com>
syncd/syncd_notifications.cpp
Outdated
@@ -535,6 +535,7 @@ void ntf_process_function() | |||
while (runThread) | |||
{ | |||
cv.wait(ulock); | |||
if (! runThread) break; |
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.
this is not needed, it will be checked after tryDequeue anyway
@@ -559,8 +560,6 @@ void startNotificationsProcessingThread() | |||
runThread = true; | |||
|
|||
ntf_process_thread = std::make_shared<std::thread>(ntf_process_function); | |||
|
|||
ntf_process_thread->detach(); |
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.
yea this was causing issue
This change has been tested with sonic-net/sonic-mgmt#631 for more than 20 iterations. All passed. |
[syncd] stop notification thread before calling remove_switch() [notif] don't detach syncd notification thread So that we could join() it at shutdown time. Signed-off-by: Ying Xie <ying.xie@microsoft.com> [flex counter] remove all flex counters before exiting syncd Remove the early quit Add log enter to removeAllCounters()
[syncd] stop notification thread before calling remove_switch() [notif] don't detach syncd notification thread So that we could join() it at shutdown time. Signed-off-by: Ying Xie <ying.xie@microsoft.com> [flex counter] remove all flex counters before exiting syncd Remove the early quit Add log enter to removeAllCounters()
[syncd] stop notification thread before calling remove_switch() [notif] don't detach syncd notification thread So that we could join() it at shutdown time. Signed-off-by: Ying Xie <ying.xie@microsoft.com> [flex counter] remove all flex counters before exiting syncd Remove the early quit Add log enter to removeAllCounters()
[syncd] stop notification thread before calling remove_switch() [notif] don't detach syncd notification thread So that we could join() it at shutdown time. Signed-off-by: Ying Xie <ying.xie@microsoft.com> [flex counter] remove all flex counters before exiting syncd Remove the early quit Add log enter to removeAllCounters()
[syncd] stop notification thread before calling remove_switch() [notif] don't detach syncd notification thread So that we could join() it at shutdown time. Signed-off-by: Ying Xie <ying.xie@microsoft.com> [flex counter] remove all flex counters before exiting syncd Remove the early quit Add log enter to removeAllCounters()