Browse Source

sleep before re-reading the messages

If there are no more metadata changes and the client disconnects, it would go into a busy loop without this fix.
pull/2179/head
Chris Lu 4 years ago
parent
commit
17477b37d5
  1. 4
      weed/server/filer_grpc_server_sub_meta.go

4
weed/server/filer_grpc_server_sub_meta.go

@ -55,14 +55,16 @@ func (fs *FilerServer) SubscribeMetadata(req *filer_pb.SubscribeMetadataRequest,
}, eachLogEntryFn) }, eachLogEntryFn)
if err != nil { if err != nil {
if err == log_buffer.ResumeFromDiskError { if err == log_buffer.ResumeFromDiskError {
time.Sleep(5127 * time.Millisecond)
continue continue
} }
glog.Errorf("processed to %v: %v", lastReadTime, err) glog.Errorf("processed to %v: %v", lastReadTime, err)
time.Sleep(3127 * time.Millisecond)
if err != log_buffer.ResumeError { if err != log_buffer.ResumeError {
break break
} }
} }
time.Sleep(5127 * time.Millisecond)
} }
return err return err

Loading…
Cancel
Save