From 1eb07051a4a7594bf063de6b9ede1fecd038d7ff Mon Sep 17 00:00:00 2001 From: arithmeticmean Date: Mon, 9 Jun 2025 17:14:51 +0530 Subject: [PATCH] fix(logs): keep log streaming active until containers fully stop Prevents loss of final log messages during SIGINT/SIGTERM shutdown by maintaining log collection until containers complete their stop sequence. Fixes #12918 Signed-off-by: arithmeticmean --- pkg/compose/up.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compose/up.go b/pkg/compose/up.go index 70ac9f917e3..c040a1c6307 100644 --- a/pkg/compose/up.go +++ b/pkg/compose/up.go @@ -96,13 +96,13 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options eg.Go(func() error { first := true gracefulTeardown := func() { - printer.Cancel() _, _ = fmt.Fprintln(s.stdinfo(), "Gracefully stopping... (press Ctrl+C again to force)") eg.Go(func() error { err := s.Stop(context.WithoutCancel(ctx), project.Name, api.StopOptions{ Services: options.Create.Services, Project: project, }) + printer.Cancel() isTerminated.Store(true) return err })