Skip to content

Commit

Permalink
chore: stop warehouse panics (#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
cisse21 committed Mar 20, 2023
1 parent 9ecf514 commit 0630253
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions warehouse/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
var (
ErrIncompatibleSchemaConversion = errors.New("incompatible schema conversion")
ErrSchemaConversionNotSupported = errors.New("schema conversion not supported")
ErrCancellingStatement = errors.New("[error] pq: canceling statement due to user request")
)

type InvalidDestinationCredErr struct {
Expand Down
7 changes: 6 additions & 1 deletion warehouse/warehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,12 @@ loop:
wh.Logger.Debugf(`Current inProgress namespace identifiers for %s: %v`, wh.destType, inProgressNamespaces)

uploadJobsToProcess, err := wh.getUploadsToProcess(ctx, availableWorkers, inProgressNamespaces)
if err != nil {

switch err {
case nil:
case context.Canceled, context.DeadlineExceeded, ErrCancellingStatement:
break loop
default:
wh.Logger.Errorf(`Error executing getUploadsToProcess: %v`, err)
panic(err)
}
Expand Down

0 comments on commit 0630253

Please sign in to comment.