Skip to content

[Syncd] make sure syncd can exit gracefully#321

Merged
yxieca merged 5 commits intosonic-net:masterfrom
yxieca:syncd
May 24, 2018
Merged

[Syncd] make sure syncd can exit gracefully#321
yxieca merged 5 commits intosonic-net:masterfrom
yxieca:syncd

Conversation

@yxieca
Copy link
Contributor

@yxieca yxieca commented May 24, 2018

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

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


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 <[email protected]>

[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 <[email protected]>

[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 <[email protected]>

[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 <[email protected]>

[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 <[email protected]>

[flex counter] remove all flex counters before exiting syncd

Remove the early quit

Add log enter to removeAllCounters()
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