Browse Source

reader: avoid wrong pattern detection due to lock waiting

pull/2550/head
chrislu 3 years ago
parent
commit
9a00c17555
  1. 4
      weed/filer/reader_at.go

4
weed/filer/reader_at.go

@ -105,11 +105,11 @@ func (c *ChunkReadAt) Close() error {
func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) {
c.readerPattern.MonitorReadAt(offset, len(p))
c.readerLock.Lock()
defer c.readerLock.Unlock()
c.readerPattern.MonitorReadAt(offset, len(p))
// glog.V(4).Infof("ReadAt [%d,%d) of total file size %d bytes %d chunk views", offset, offset+int64(len(p)), c.fileSize, len(c.chunkViews))
return c.doReadAt(p, offset)
}

Loading…
Cancel
Save