Skip to content

Commit

Permalink
Return table upload error instead of semaphore error
Browse files Browse the repository at this point in the history
feat: return upload error instead of context canceled
commit_hash:0936bcfcce88efe8858262f9d184c7f9ae0e8dc8
  • Loading branch information
DenisEvd committed Sep 19, 2024
1 parent 319a680 commit b72216a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/worker/tasks/load_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,9 @@ func (l *SnapshotLoader) DoUploadTables(ctx context.Context, source abstract.Sto
for {
if err := parallelismSemaphore.Acquire(ctx, 1); err != nil {
logger.Log.Error("Failed to acquire semaphore to load next table", log.Any("worker_index", l.workerIndex), log.Error(ctx.Err()))
if tableUploadErr != nil {
return errors.CategorizedErrorf(categories.Internal, "Upload error: %w", err)
}
return errors.CategorizedErrorf(categories.Internal, "failed to acquire semaphore: %w", err)
}
waitToComplete.Add(1)
Expand Down

0 comments on commit b72216a

Please sign in to comment.