From de5bb88a714811de16682634bcf7013c3cb43f0f Mon Sep 17 00:00:00 2001 From: Maximilian Pass <22845248+mpass99@users.noreply.github.com> Date: Tue, 23 Jul 2024 23:54:06 +0200 Subject: [PATCH] Group Sentry issue by throwing the log warning at the common level of the Execute call and not at multiple places relying on it. --- internal/api/runners.go | 3 --- internal/nomad/api_querier.go | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/runners.go b/internal/api/runners.go index b5851081..2454962e 100644 --- a/internal/api/runners.go +++ b/internal/api/runners.go @@ -147,9 +147,6 @@ func (r *RunnerController) updateFileSystem(writer http.ResponseWriter, request case errors.Is(err, nomadApi.NodeDownErr): entry.Debug("Nomad Node Down while updateFileSystem") writeInternalServerError(request.Context(), writer, err, dto.ErrorNomadInternalServerError) - case errors.Is(err, io.ErrUnexpectedEOF): - entry.Warn("Unexpected EOF while updateFileSystem") - writeInternalServerError(request.Context(), writer, err, dto.ErrorUnknown) case errors.Is(err, nomad.ErrNoAllocationFound): entry.Warn("No allocation found while updateFileSystem") writeInternalServerError(request.Context(), writer, err, dto.ErrorUnknown) diff --git a/internal/nomad/api_querier.go b/internal/nomad/api_querier.go index 8a1a5475..b434fcf7 100644 --- a/internal/nomad/api_querier.go +++ b/internal/nomad/api_querier.go @@ -138,6 +138,9 @@ func (nc *nomadAPIClient) Execute(ctx context.Context, runnerID string, cmd stri case errors.Is(err, context.Canceled): log.WithContext(ctx).Debug("Execution canceled by context") return 0, nil + case errors.Is(err, io.ErrUnexpectedEOF): + log.WithContext(ctx).WithError(err).Warn("Unexpected EOF for Execute") + return 0, nil case strings.Contains(err.Error(), "Unknown allocation"): return 1, ErrNomadUnknownAllocation default: