-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from KCSesh/release/v0.11.8
Version v0.11.8
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.11.7 | ||
v0.11.8 |
52 changes: 52 additions & 0 deletions
52
systemd-patches/9504-core-skip-restart-when-a-JOB_STOP-job-is-pending.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
From c972880640ee19e89ce9265d8eae1b3aae190332 Mon Sep 17 00:00:00 2001 | ||
From: Franck Bui <[email protected]> | ||
Date: Fri, 18 Feb 2022 10:06:24 +0100 | ||
Subject: [PATCH] core: really skip automatic restart when a JOB_STOP job is | ||
pending | ||
|
||
It's not clear why we rescheduled a service auto restart while a stop job for | ||
the unit was pending. The comment claims that the unit shouldn't be restarted | ||
but the code did reschedule an auto restart meanwhile. | ||
|
||
In practice that was rarely an issue because the service waited for the next | ||
auto restart to be rescheduled, letting the queued stop job to be proceed and | ||
service_stop() to be called preventing the next restart to complete. | ||
|
||
However when RestartSec=0, the timer expired right away making PID1 to | ||
reschedule the unit again, making the timer expired right away... and so | ||
on. This busy loop prevented PID1 to handle any queued jobs (and hence giving | ||
no chance to the start rate limiting to trigger), which made the busy loop last | ||
forever. | ||
|
||
This patch breaks this loop by skipping the reschedule of the unit auto restart | ||
and hence not depending on the value of u->restart_usec anymore. | ||
|
||
Fixes: #13667 | ||
|
||
[kssessio: backport to v219] | ||
Signed-off-by: Kyle Sessions <[email protected]> | ||
--- | ||
src/core/service.c | 7 +------ | ||
1 file changed, 1 insertion(+), 6 deletions(-) | ||
|
||
diff --git a/src/core/service.c b/src/core/service.c | ||
index 15e29be..fa2af05 100644 | ||
--- a/src/core/service.c | ||
+++ b/src/core/service.c | ||
@@ -1622,12 +1622,7 @@ static void service_enter_restart(Service *s) { | ||
|
||
if (UNIT(s)->job && UNIT(s)->job->type == JOB_STOP) { | ||
/* Don't restart things if we are going down anyway */ | ||
- log_unit_info(UNIT(s)->id, "Stop job pending for unit, delaying automatic restart."); | ||
- | ||
- r = service_arm_timer(s, s->restart_usec); | ||
- if (r < 0) | ||
- goto fail; | ||
- | ||
+ log_unit_info(UNIT(s)->id, "Stop job pending for unit, skipping automatic restart."); | ||
return; | ||
} | ||
|
||
-- | ||
2.40.1 | ||
|