mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reader: avoid wrong pattern detection due to lock waiting
This commit is contained in:
parent
f7a6f6b4c0
commit
9a00c17555
|
@ -105,11 +105,11 @@ func (c *ChunkReadAt) Close() error {
|
||||||
|
|
||||||
func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) {
|
func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) {
|
||||||
|
|
||||||
|
c.readerPattern.MonitorReadAt(offset, len(p))
|
||||||
|
|
||||||
c.readerLock.Lock()
|
c.readerLock.Lock()
|
||||||
defer c.readerLock.Unlock()
|
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))
|
// 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)
|
return c.doReadAt(p, offset)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue