-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[BFN] Canceling PSU platform API calls on SIGTERM #10720
Conversation
@prgeor , please review. Thank you |
@lguohan , please approve and merge. Thanks |
@prgeor , could you please take a look? |
@prgeor , could you please approve and merge? Thanks |
@lguohan , please approve and merge. Thanks |
@qiluo-msft , please approve and merge. Thank you |
450e074
to
58e88d3
Compare
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
34edc30
to
ddc9d5a
Compare
ac11afa
to
ed12d89
Compare
Sorry for late response, we will soon review it. |
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.
I checked this PR and it's not conflict with the recent change in libswsscommon.
Because this project is a pure python project and not using pubsub from swsscommon, so the signal handler in this PR will not be blocked by the infinite loop in pubsub.
platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py
Show resolved
Hide resolved
ed12d89
to
4341a4a
Compare
Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>
Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>
Signed-off-by: Andriy Kokhan andriyx.kokhan@intel.com
Co-authored-by: Taras Keryk tarasx.keryk@intel.com
Why I did it
Sometime, SIGTERM processing by psud takes more then default 10sec (please see stopwaitsecs in http://supervisord.org/configuration.html).
Due to this, the following two testcases may fail:
Also, limited
get_bmc_version()
execution time to 1 sec.How I did it
Introduced two levels of SIGTERM handlers:
signal_handler()
that executes a default handler (psud
SIGTERM handler) and avoids subsequentpsu_info_get()
executions.cancel_on_sigterm()
decorator that executes class levelsignal_handler()
and raises an exception to cancel currentpsu_info_get()
execution.How to verify it
Run SONiC CTs:
Which release branch to backport (provide reason below if selected)