-
Notifications
You must be signed in to change notification settings - Fork 661
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
[config reload] Fix config reload failure due to sonic.target job cancellation #1814
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -686,7 +686,7 @@ def _stop_services(): | |
pass | ||
|
||
click.echo("Stopping SONiC target ...") | ||
clicommon.run_command("sudo systemctl stop sonic.target") | ||
clicommon.run_command("sudo systemctl stop sonic.target --job-mode replace-irreversibly") | ||
|
||
|
||
def _get_sonic_services(): | ||
|
@@ -706,7 +706,7 @@ def _reset_failed_services(): | |
|
||
def _restart_services(): | ||
click.echo("Restarting SONiC target ...") | ||
clicommon.run_command("sudo systemctl restart sonic.target") | ||
clicommon.run_command("sudo systemctl restart sonic.target --job-mode replace-irreversibly") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vivekreddynv please double check this change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vivekreddynv It looks like if restart is executed with
Could you please double check? I think we only need to stop services with the guaranty that it will be successfully executed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when the restart job (and all the other dependent jobs) are finished and is taken out of systemd's job queue, i don't think the next stop job will be cancelled. However, simultaneous config reloads in the quick succession, can lead to the behavior you have said.
The problem here is that the sonic.target start is not a blocking call unlike sonic.target stop. Nevertheless, the idea of this PR is that config reload should not fail and thus it makes sense to remove this. I'll raise a separate PR |
||
|
||
try: | ||
subprocess.check_call("sudo monit status", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) | ||
|
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.
Can we add this option also for systemctl restart sonic.target case at line#709
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.
Added !