Skip to content
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

Merged
merged 5 commits into from
May 24, 2018
Merged

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented May 24, 2018

  • Stop notification thread before removing switch
  • Stop flex counter queries before removing switch

@@ -535,6 +535,7 @@ void ntf_process_function()
while (runThread)
{
cv.wait(ulock);
if (! runThread) break;
Copy link
Collaborator

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();
Copy link
Collaborator

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

@yxieca
Copy link
Contributor Author

yxieca commented May 24, 2018

This change has been tested with sonic-net/sonic-mgmt#631 for more than 20 iterations. All passed.

@yxieca yxieca merged commit 0d6bdbd into sonic-net:master May 24, 2018
@yxieca yxieca deleted the syncd branch May 24, 2018 21:14
yxieca added a commit that referenced this pull request May 24, 2018
[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()
yxieca added a commit to yxieca/sonic-sairedis that referenced this pull request May 24, 2018
[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()
lguohan pushed a commit that referenced this pull request May 24, 2018
[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()
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
[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()
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
[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()
jianyuewu pushed a commit to jianyuewu/sonic-sairedis that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants