Skip to content

Commit 4b821d0

Browse files
authored
fix(indexer): wait for persist routines to complete in Close (#396)
fixes #374
1 parent 772205f commit 4b821d0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

chain/indexer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ func (t *TipSetIndexer) Close() error {
446446
log.Errorw("error received while closing actor task processor", "error", err, "task", name)
447447
}
448448
}
449+
// ensure there are no persist go routines left running
450+
t.persistSlot <- struct{}{}
449451
return nil
450452
}
451453

vector/runner.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"errors"
99
"fmt"
1010
"os"
11-
"time"
1211

1312
"github.com/google/go-cmp/cmp/cmpopts"
1413

@@ -118,8 +117,6 @@ func (r *Runner) Run(ctx context.Context) error {
118117
if err := chain.NewWalker(tsIndexer, r.opener, r.schema.Params.From, r.schema.Params.To).Run(ctx); err != nil && !errors.Is(err, context.Canceled) {
119118
return err
120119
}
121-
// TODO remove when https://github.com/filecoin-project/sentinel-visor/issues/374 is fixed
122-
time.Sleep(3 * time.Second)
123120
return nil
124121
}
125122

0 commit comments

Comments
 (0)