-
Notifications
You must be signed in to change notification settings - Fork 744
[reload] stop timers on reload #4021
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
base: master
Are you sure you want to change the base?
[reload] stop timers on reload #4021
Conversation
Signed-off-by: Stepan Blyschak <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@stepanblyschak Lets have the label until Azure/sonic-utilities.msft#226 is merged. @r12f This is an issue we found in 202412 testing. Please help to prioritize |
thanks Sud! merged in 202412 already. |
|
||
# Get the list of dependencies for sonic.target to fetch timer units | ||
for service in _get_sonic_services(): | ||
if service.endswith('.timer'): |
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.
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.
Here's one of the timers:
# /lib/systemd/system/hostcfgd.timer
[Unit]
Description=Delays hostcfgd daemon until SONiC has started
PartOf=hostcfgd.service
[Timer]
OnUnitActiveSec=0 sec
OnBootSec=1min 30 sec
Unit=hostcfgd.service
[Install]
WantedBy=timers.target sonic.target
The relation between sonic.target and the timer is only WantedBy
, meaning start of sonic.target
starts the timer but does not stop it
What I did
I implemented a fix to stop timers upon reload/load_minigraph. If "config reload" or "config load_minigraph" is executed soon after system has started a timer may expire in the middle of the command causing subsequent failures.
Here's what is observed:
How I did it
Stop timers associated with sonic.target
How to verify it
I put a breakpoint after stopping sonic.target. Soon after reboot I execute "config reload" command. I then wait for ~5-6 min, no services start. Without this fix, services would start.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)