From 290a58286fe26eb32441ebb65200b71e38e07f5a Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 10 May 2021 09:16:25 -0700 Subject: [PATCH] Add client disconnect to build handler loop [NO TESTS NEEDED] In process of debugging added request channel check and logging message to build loop. Unable to recreate build drop issue after this. 68k build iterations without fail. Signed-off-by: Jhon Honce --- pkg/api/handlers/compat/images_build.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index ec40fdd2d2..6ff5572916 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -24,7 +24,7 @@ import ( "github.com/containers/podman/v3/pkg/channel" "github.com/containers/storage/pkg/archive" "github.com/gorilla/schema" - specs "github.com/opencontainers/runtime-spec/specs-go" + "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -553,6 +553,10 @@ loop: } } break loop + case <-r.Context().Done(): + cancel() + logrus.Infof("Client disconnect reported for build %q / %q.", registry, query.Dockerfile) + return } } }