fix blockstore panic (#1570)

This commit is contained in:
Mike Sawka 2024-12-19 10:35:50 -08:00 committed by GitHub
parent 0925af5300
commit 8ae6e47d9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -227,6 +227,9 @@ func (entry *CacheEntry) readAt(ctx context.Context, offset int64, size int64, r
offset += truncateAmt
size -= truncateAmt
}
if size <= 0 {
return realDataOffset, nil, nil
}
}
partMap := file.computePartMap(offset, size)
dataEntryMap, err := entry.loadDataPartsForRead(ctx, getPartIdxsFromMap(partMap))

View File

@ -342,7 +342,10 @@ func (w *WshRpc) runServer() {
continue
}
if msg.IsRpcRequest() {
go w.handleRequest(&msg)
go func() {
defer panichandler.PanicHandler("handleRequest:goroutine")
w.handleRequest(&msg)
}()
} else {
respCh := w.getResponseCh(msg.ResId)
if respCh == nil {