[ledd] Use select() with timeout for AppDB notifications#15
Closed
serhepopovych wants to merge 1 commit intosonic-net:masterfrom
OrdnanceNetworks:fix-ledd-signal-handling
Closed
[ledd] Use select() with timeout for AppDB notifications#15serhepopovych wants to merge 1 commit intosonic-net:masterfrom OrdnanceNetworks:fix-ledd-signal-handling
serhepopovych wants to merge 1 commit intosonic-net:masterfrom
OrdnanceNetworks:fix-ledd-signal-handling
Conversation
Overwise ledd ignores signals other than SIGKILL making impossible to use __del__() destructors in LedClass implementations and delays pmon docker container shutdown up to 10s. Here is output from /var/log/supervisor/supervisord.log after "systemctl stop pmon": 2018-05-26 10:40:36,323 WARN received SIGTERM indicating exit request 2018-05-26 10:40:36,323 INFO waiting for rsyslogd, ledd to die 2018-05-26 10:40:39,327 INFO waiting for rsyslogd, ledd to die 2018-05-26 10:40:42,330 INFO waiting for rsyslogd, ledd to die 2018-05-26 10:40:45,335 INFO waiting for rsyslogd, ledd to die Note that according to docker-stop(1) default time to wait before retry with KILL signal is 10s. Steps to reproduce: # docker exec -ti pmon bash # kill -TERM $(pgrep ledd) # kill -INT $(pgrep ledd) # kill -0 $(pgrep ledd) && echo 'alive' alive # kill -KILL $(pgrep ledd) Process survives TERM and INT signals, and killed only in 5) by KILL. Other C++ code already uses SELECT_TIMEOUT = 1000 to return control into main loop and checks for state. Signed-off-by: Sergey Popovich <sergey.popovich@ordnance.co>
Contributor
Author
|
Typos in commit description. |
vdahiya12
pushed a commit
to vdahiya12/sonic-platform-daemons
that referenced
this pull request
Apr 4, 2022
vdahiya12
pushed a commit
to vdahiya12/sonic-platform-daemons
that referenced
this pull request
Apr 4, 2022
This reverts commit 3b1f0ef.
vvolam
pushed a commit
to vvolam/sonic-platform-daemons
that referenced
this pull request
Jun 16, 2025
…-net#15) Depends on sonic-net/sonic-platform-common#564 <!-- Provide a general summary of your changes in the Title above --> #### Description Ignore time wait in `cmis.set_lpmode` #### Motivation and Context In `CmisManagerTask`, it calls `cmis.set_lpmode` for each logical port. The time wait causes a `wait_time failure_prs.log skip_prs.log num_of_logical_port` delay in link up time. The PR is to optimize it. #### How Has This Been Tested? Manual test unit test #### Additional Information (Optional)
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.
Otherwise ledd ignores signals other than SIGKILL making impossible to
use del() destructors in LedClass implementations and delays pmon
docker container shutdown up to 10s.
Here is output from /var/log/supervisor/supervisord.log after
"systemctl stop pmon":
2018-05-26 10:40:36,323 WARN received SIGTERM indicating exit request
2018-05-26 10:40:36,323 INFO waiting for rsyslogd, ledd to die
2018-05-26 10:40:39,327 INFO waiting for rsyslogd, ledd to die
2018-05-26 10:40:42,330 INFO waiting for rsyslogd, ledd to die
2018-05-26 10:40:45,335 INFO waiting for rsyslogd, ledd to die
Note that according to docker-stop(1) default time to wait before retry
with KILL signal is 10s.
Steps to reproduce:
docker exec -ti pmon bash
kill -TERM $(pgrep ledd)
kill -INT $(pgrep ledd)
kill -0 $(pgrep ledd) && echo 'alive'
alive
kill -KILL $(pgrep ledd)
Process survives TERM and INT signals, and killed only in 5) by KILL.
Other C++ code already uses SELECT_TIMEOUT = 1000 to return control
into main loop and checks for state.
Signed-off-by: Sergey Popovich sergey.popovich@ordnance.co