E7: stop the tool runner alone and wait its drain bound
The service manager's stop signalled the tool runner's whole group, so its bundles died with their calls. The composer carries the runner's drain-bound setting on its process; the unit stops the runner alone and waits the bound and 15 s before it kills what is left, so the new runner starts only after the old one exits or that bound passes. Builds: design 47 H2 §813 (12); H-A-353; H-A-358
This commit is contained in:
@@ -43,6 +43,16 @@ func TestTheUnitRunsWhatTheDaemonSaid(t *testing.T) {
|
||||
if strings.Contains(unit, "Type=oneshot") {
|
||||
t.Fatalf("a process that should stay up is declared a step:\n%s", unit)
|
||||
}
|
||||
// Design 47 H2 §813 (12), H-A-353, H-A-358: a process that drains is stopped alone, its stop waiting its drain bound and
|
||||
// 15 s for its children; one that does not keeps the service manager's defaults.
|
||||
if strings.Contains(unit, "KillMode=") || strings.Contains(unit, "TimeoutStopSec=") {
|
||||
t.Fatalf("a process with no drain bound has its stop written:\n%s", unit)
|
||||
}
|
||||
draining := aProcess()
|
||||
draining.DrainBound = 30
|
||||
if got := unitFor(draining); !strings.Contains(got, "Restart=always\nRestartSec=5\nKillMode=mixed\nTimeoutStopSec=45s\n\n[Install]") {
|
||||
t.Fatalf("a process with a drain bound of 30 s is not stopped alone within 45 s:\n%s", got)
|
||||
}
|
||||
}
|
||||
|
||||
// **Deterministic, because the unit is half the daemon's identity.** Environment held in a map
|
||||
|
||||
Reference in New Issue
Block a user