Skip to content

Commit

Permalink
fix(f3): don't return an error on stop if our context was canceled (#…
Browse files Browse the repository at this point in the history
…12592)

Otherwise, the node's `stop` function returns an error and the
splitstore and window post dispute tests randomly fail.
  • Loading branch information
Stebalien authored and rjan90 committed Oct 14, 2024
1 parent f328e87 commit 171c2ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chain/lf3/participation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package lf3
import (
"context"
"errors"
"fmt"
"time"

"github.com/jpillora/backoff"
Expand Down Expand Up @@ -82,8 +83,12 @@ func (p *Participant) Stop(ctx context.Context) error {

func (p *Participant) run(ctx context.Context) (_err error) {
defer func() {
if ctx.Err() == nil && _err != nil {
log.Errorw("F3 participation stopped unexpectedly", "error", _err)
if ctx.Err() != nil {
_err = nil
}
if _err != nil {
_err = fmt.Errorf("F3 participant stopped unexpectedly: %w", _err)
log.Error(_err)
}
}()

Expand Down

0 comments on commit 171c2ff

Please sign in to comment.