We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
*LogRotate
volatile sig_atomic_t
Currently the LogRotate variables in orchagent/main.cpp are not signal safe.
https://en.cppreference.com/w/cpp/utility/program/signal
bool should be changed to volatile sig_atomic_t or atomic_bool: https://github.com/Azure/sonic-swss/blob/bb0733aa67ffc4e430e70bcf2db2dc6316172b32/orchagent/main.cpp#L57-L58
bool
atomic_bool
Then, references are safe in the signal handler: https://github.com/Azure/sonic-swss/blob/bb0733aa67ffc4e430e70bcf2db2dc6316172b32/orchagent/main.cpp#L95-L102
References to these variables should happen atomically in the log rotation code. For example, https://github.com/Azure/sonic-swss/blob/ceca17c9b83db4dc1df517026e2153c730b4cf9f/orchagent/response_publisher.cpp#L40-L44
Should use atomic exchange.
if (!gResponsePublisherLogRotate.exchange(false)) { return; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently the LogRotate variables in orchagent/main.cpp are not signal safe.
https://en.cppreference.com/w/cpp/utility/program/signal
bool
should be changed tovolatile sig_atomic_t
oratomic_bool
:https://github.com/Azure/sonic-swss/blob/bb0733aa67ffc4e430e70bcf2db2dc6316172b32/orchagent/main.cpp#L57-L58
Then, references are safe in the signal handler:
https://github.com/Azure/sonic-swss/blob/bb0733aa67ffc4e430e70bcf2db2dc6316172b32/orchagent/main.cpp#L95-L102
References to these variables should happen atomically in the log rotation code. For example,
https://github.com/Azure/sonic-swss/blob/ceca17c9b83db4dc1df517026e2153c730b4cf9f/orchagent/response_publisher.cpp#L40-L44
Should use atomic exchange.
The text was updated successfully, but these errors were encountered: