Skip to content

Commit e0eb62d

Browse files
authored
Merge pull request #150 from ipfs/fix/repair-timeout
repair: add timeout GetDelta operation during repair
2 parents 325bd1a + 38cf70c commit e0eb62d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crdt.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,10 +923,14 @@ func (store *Datastore) repairDAG() error {
923923
cur := nh.node
924924
head := nh.head
925925

926-
n, delta, err := getter.GetDelta(store.ctx, cur)
926+
ctx, cancel := context.WithTimeout(store.ctx, store.opts.DAGSyncerTimeout)
927+
n, delta, err := getter.GetDelta(ctx, cur)
927928
if err != nil {
929+
cancel()
928930
return errors.Wrapf(err, "error getting node for reprocessing %s", cur)
929931
}
932+
cancel()
933+
930934
isProcessed, err := store.isProcessed(cur)
931935
if err != nil {
932936
return errors.Wrapf(err, "error checking for reprocessed block %s", cur)

0 commit comments

Comments
 (0)