Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
storage: fix LazyChunkReader.join potential deadlock (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
janos authored and acud committed Aug 15, 2019
1 parent 12709bd commit ec471e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions storage/chunker.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ func (r *LazyChunkReader) join(ctx context.Context, b []byte, off int64, eoff in
case errC <- fmt.Errorf("chunk %v-%v not found; key: %s", off, off+treeSize, fmt.Sprintf("%x", childAddress)):
case <-quitC:
}
wg.Done()
return
}
metrics.GetOrRegisterResettingTimer("lcr.getter.get", nil).UpdateSince(startTime)
Expand All @@ -548,6 +549,7 @@ func (r *LazyChunkReader) join(ctx context.Context, b []byte, off int64, eoff in
case errC <- fmt.Errorf("chunk %v-%v incomplete; key: %s, data length %v", off, off+treeSize, fmt.Sprintf("%x", childAddress), l):
case <-quitC:
}
wg.Done()
return
}
if soff < off {
Expand Down

0 comments on commit ec471e8

Please sign in to comment.