From 34bc6865e52003d69188de025bfe2276033eac6c Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 8 Oct 2026 22:30:58 +1100 Subject: [PATCH] fix(archied): wait for in-flight tasks on a single-cycle run A drain pass no longer waits for the tasks it submitted, so -once (the systemd timer and test invocation) returned while their containers were still running and the process then tore them down. Wait for the pass's tasks here, restoring what the flag means. --- internal/app/archied/bootstrap.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/app/archied/bootstrap.go b/internal/app/archied/bootstrap.go index ac553bea4..664faf749 100644 --- a/internal/app/archied/bootstrap.go +++ b/internal/app/archied/bootstrap.go @@ -826,6 +826,10 @@ func (b *boot) runLoop(ctx context.Context, once bool) error { b.announceReady() if once { b.d.Cycle(ctx) + // A drain pass no longer waits for the tasks it submitted, so a + // single-cycle invocation waits for them here: exiting while their + // containers still run would kill work this pass accepted. + b.d.WaitForTasks() return nil } b.log.Info("archied running", "repos", len(b.cfg.Repos), "poll", b.cfg.PollInterval.Std().String(), "label", b.cfg.Label)