mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reduce busy waiting when reading metadata logs
This commit is contained in:
parent
2f846777bb
commit
7e25a2d416
|
@ -128,7 +128,6 @@ func (broker *MessageBroker) Subscribe(stream messaging_pb.SeaweedMessaging_Subs
|
|||
continue
|
||||
}
|
||||
glog.Errorf("processed to %v: %v", lastReadTime, err)
|
||||
time.Sleep(3127 * time.Millisecond)
|
||||
if err != log_buffer.ResumeError {
|
||||
break
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ func (fs *FilerServer) SubscribeMetadata(req *filer_pb.SubscribeMetadataRequest,
|
|||
}, eachLogEntryFn)
|
||||
if readInMemoryLogErr != nil {
|
||||
if readInMemoryLogErr == log_buffer.ResumeFromDiskError {
|
||||
time.Sleep(1127 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
glog.Errorf("processed to %v: %v", lastReadTime, readInMemoryLogErr)
|
||||
|
@ -127,7 +126,6 @@ func (fs *FilerServer) SubscribeLocalMetadata(req *filer_pb.SubscribeMetadataReq
|
|||
return true
|
||||
}, eachLogEntryFn)
|
||||
if readInMemoryLogErr != nil {
|
||||
time.Sleep(1127 * time.Millisecond)
|
||||
if readInMemoryLogErr == log_buffer.ResumeFromDiskError {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startTreadTime
|
|||
}
|
||||
bytesBuf, err = logBuffer.ReadFromBuffer(lastReadTime)
|
||||
if err == ResumeFromDiskError {
|
||||
time.Sleep(1127 * time.Millisecond)
|
||||
return lastReadTime, ResumeFromDiskError
|
||||
}
|
||||
// glog.V(4).Infof("%s ReadFromBuffer by %v", readerName, lastReadTime)
|
||||
|
|
Loading…
Reference in a new issue