Skip to content

Commit

Permalink
Merge pull request #867 from bhandras/test-flake-fixup
Browse files Browse the repository at this point in the history
loop: do not error out on context done in the executor
  • Loading branch information
bhandras authored Dec 12, 2024
2 parents d198bb8 + a107036 commit 2d31b40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (s *executor) run(mainCtx context.Context,
defer s.wg.Done()

err := s.batcher.Run(mainCtx)
if err != nil {
if err != nil && !errors.Is(err, context.Canceled) {
select {
case batcherErrChan <- err:
case <-mainCtx.Done():
Expand Down Expand Up @@ -229,10 +229,10 @@ func (s *executor) run(mainCtx context.Context,
}

case err := <-blockErrorChan:
return fmt.Errorf("block error: %v", err)
return fmt.Errorf("block error: %w", err)

case err := <-batcherErrChan:
return fmt.Errorf("batcher error: %v", err)
return fmt.Errorf("batcher error: %w", err)

case <-mainCtx.Done():
return mainCtx.Err()
Expand Down

0 comments on commit 2d31b40

Please sign in to comment.