fix(#636): stop before kill in cold-start fallback (argus)
This commit is contained in:
parent
b3fde40ac8
commit
fdd5fa2977
1 changed files with 14 additions and 5 deletions
|
|
@ -444,17 +444,26 @@ pub async fn rebuild_no_meta(
|
||||||
// the old-generation activation references units that no longer
|
// the old-generation activation references units that no longer
|
||||||
// exist in the new closure, causing systemd to exit non-zero.
|
// exist in the new closure, causing systemd to exit non-zero.
|
||||||
//
|
//
|
||||||
// Fallback: kill + start (cold-start). `kill` SIGKILLs any
|
// Fallback: stop + kill + start (cold-start). The activation
|
||||||
// lingering container processes so the next `start` enters a
|
// script can fail when packages are removed between generations —
|
||||||
// clean state without a generation transition, letting the
|
// `start` exits non-zero but the container may be half-started.
|
||||||
// activation succeed.
|
// `stop` requests a graceful SIGTERM drain; `kill` then SIGKILLs
|
||||||
|
// any lingering processes so the next `start` enters a clean state
|
||||||
|
// without a generation transition, letting the activation succeed.
|
||||||
if let Err(start_err) = run(&["start", &container]).await {
|
if let Err(start_err) = run(&["start", &container]).await {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
container = %container,
|
container = %container,
|
||||||
error = %start_err,
|
error = %start_err,
|
||||||
"start after rebuild failed (possible activation error); \
|
"start after rebuild failed (possible activation error); \
|
||||||
retrying via kill + start"
|
retrying via stop + kill + start"
|
||||||
);
|
);
|
||||||
|
run(&["stop", &container]).await.unwrap_or_else(|e| {
|
||||||
|
tracing::warn!(
|
||||||
|
container = %container,
|
||||||
|
error = %e,
|
||||||
|
"stop before cold-start retry failed (ignored)"
|
||||||
|
);
|
||||||
|
});
|
||||||
run(&["kill", &container]).await.unwrap_or_else(|e| {
|
run(&["kill", &container]).await.unwrap_or_else(|e| {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
container = %container,
|
container = %container,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue