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

storage: fix LazyChunkReader.join potential deadlock #1670

Merged
merged 1 commit into from
Aug 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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