Skip to content

Commit

Permalink
chore: fix stuck runUploadJobAllocator (#5191)
Browse files Browse the repository at this point in the history
  • Loading branch information
cisse21 authored Oct 14, 2024
1 parent 0e44f18 commit ae9d984
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions warehouse/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"sync/atomic"
"time"

"github.com/lib/pq"
"golang.org/x/sync/errgroup"

"github.com/samber/lo"
Expand Down Expand Up @@ -377,18 +376,9 @@ loop:
r.logger.Debugf(`Current inProgress namespace identifiers for %s: %v`, r.destType, inProgressNamespaces)

uploadJobsToProcess, err := r.uploadsToProcess(ctx, availableWorkers, inProgressNamespaces)
if err != nil {
var pqErr *pq.Error

switch {
case errors.Is(err, context.Canceled),
errors.Is(err, context.DeadlineExceeded),
errors.As(err, &pqErr) && pqErr.Code == "57014":
break loop
default:
r.logger.Errorf(`Error executing uploadsToProcess: %v`, err)
return err
}
if err != nil && ctx.Err() == nil {
r.logger.Errorn("Error getting uploads to process", logger.NewErrorField(err))
return err
}

for _, uploadJob := range uploadJobsToProcess {
Expand Down

0 comments on commit ae9d984

Please sign in to comment.