From 8a5f486715a967c2d2171e3e3af6c4c938a16095 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Tue, 11 Jun 2024 17:02:15 +0200 Subject: [PATCH] osbuildexecutor: wait until worker-executor closes the connection Otherwise the client will try to fetch the output archive before the build output is archived on the worker-executor side. --- internal/osbuildexecutor/runner-impl-aws-ec2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/osbuildexecutor/runner-impl-aws-ec2.go b/internal/osbuildexecutor/runner-impl-aws-ec2.go index f6fc98bef..86277c34f 100644 --- a/internal/osbuildexecutor/runner-impl-aws-ec2.go +++ b/internal/osbuildexecutor/runner-impl-aws-ec2.go @@ -148,6 +148,11 @@ func handleBuild(inputArchive, host string) (*osbuild.Result, error) { return nil, fmt.Errorf("Unable to decode response body into osbuild result: %w", err) } + _, err = io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("Unable to wait for executor to close connection: %w", err) + } + return &osbuildResult, nil }