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

Move away sairedis logrotate from signal handler #1153

Merged
merged 2 commits into from
Dec 22, 2019

Conversation

kcudnik
Copy link
Contributor

@kcudnik kcudnik commented Dec 17, 2019

What I did
Move away logrotate from signal handler to main orch loop, to not execute any sairedis library code which potentially can be under mutex and cause deadlock when signal handler occur

Why I did it
to not execute sai_switch_api->set_attribute() under signal handler, just to set logrotate flag

How I verified it
running orchagent against vs switch and sending HUP signal to orch process

Details if related
Since flush method is executed every time that select is returning object from orchdaemon main/start loop, this is good point to check if logrotate is needed

@kcudnik
Copy link
Contributor Author

kcudnik commented Dec 18, 2019

retest this please

@@ -47,6 +47,7 @@ int gBatchSize = DEFAULT_BATCH_SIZE;
bool gSairedisRecord = true;
bool gSwssRecord = true;
bool gLogRotate = false;
bool gSaiRedisLogRotate = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add volatile ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

@@ -47,6 +47,7 @@ int gBatchSize = DEFAULT_BATCH_SIZE;
bool gSairedisRecord = true;
bool gSwssRecord = true;
bool gLogRotate = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gLogRotate [](start = 5, length = 10)

The name seems cover gSaiRedisLogRotate. Do you mean gOrchagentLogRotate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, this logrotate only covers sairedis library

@kcudnik
Copy link
Contributor Author

kcudnik commented Dec 19, 2019

not sure why tests fails on VS, seems not related to my change

@kcudnik
Copy link
Contributor Author

kcudnik commented Dec 21, 2019

retest this please

@kcudnik
Copy link
Contributor Author

kcudnik commented Dec 21, 2019

test this please

@kcudnik kcudnik requested a review from qiluo-msft December 22, 2019 01:20
@kcudnik kcudnik merged commit 77fa5a4 into sonic-net:master Dec 22, 2019
@kcudnik kcudnik deleted the sigrotate branch December 22, 2019 13:20
abdosi pushed a commit that referenced this pull request Feb 4, 2020
* Move away sairedis logrotate from signal handler

* Update tests
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
*[Cisco] enable SAI bulk API config from syncd to pass a set of Rid and review code-flow performance on cisco SAI/SDK layer. until route-check.py(sonic-utility) will not dump the associated ERR message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants