[BFN] Canceling PSU platform API calls on SIGTERM#10720
Merged
prgeor merged 2 commits intosonic-net:masterfrom Sep 29, 2022
Merged
[BFN] Canceling PSU platform API calls on SIGTERM#10720prgeor merged 2 commits intosonic-net:masterfrom
prgeor merged 2 commits intosonic-net:masterfrom
Conversation
Contributor
Author
|
@prgeor , please review. Thank you |
Contributor
Author
|
@lguohan , please approve and merge. Thanks |
Contributor
Author
Contributor
Author
|
@prgeor , could you please take a look? |
Contributor
Author
|
@prgeor , could you please approve and merge? Thanks |
Contributor
Author
|
@lguohan , please approve and merge. Thanks |
Contributor
Author
|
@qiluo-msft , please approve and merge. Thank you |
450e074 to
58e88d3
Compare
Contributor
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
34edc30 to
ddc9d5a
Compare
ac11afa to
ed12d89
Compare
Collaborator
|
Sorry for late response, we will soon review it. |
liuh-80
reviewed
May 27, 2022
Contributor
liuh-80
left a comment
There was a problem hiding this comment.
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.
liuh-80
reviewed
May 27, 2022
platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py
Outdated
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>
prgeor
approved these changes
Sep 29, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (psudSIGTERM 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)