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)
if err != nil {
if err == log_buffer.ResumeFromDiskError {
time.Sleep(5127 * time.Millisecond)
continue
}
glog.Errorf("processed to %v: %v", lastReadTime, err)
time.Sleep(3127 * time.Millisecond)
if err != log_buffer.ResumeError {
break
}
}
time.Sleep(5127 * time.Millisecond)
}
return err

Loading…
Cancel
Save