Skip to content

Commit

Permalink
Group Sentry issue
Browse files Browse the repository at this point in the history
by throwing the log warning at the common level of the Execute call and not at multiple places relying on it.
  • Loading branch information
mpass99 authored and MrSerth committed Aug 1, 2024
1 parent 84166e1 commit de5bb88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/api/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions internal/nomad/api_querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit de5bb88

Please sign in to comment.