SincereXIA commented on a change in pull request #616:
URL: https://github.com/apache/ratis/pull/616#discussion_r819217805
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
##########
@@ -349,13 +354,25 @@ private void run() {
}
}
+ private void checkAndFlush() {
+ while (running) {
+ try {
+ outStreamFlushIfNecessary();
+ flushIntervalMin.sleep();
+ } catch (Exception e) {
+ LOG.error("{} hit exception", Thread.currentThread().getName(), e);
+ Optional.ofNullable(server).ifPresent(RaftServer.Division::close);
+ }
+ }
+ }
+
private boolean shouldFlush() {
if (out == null) {
return false;
} else if (pendingFlushNum >= forceSyncNum) {
return true;
}
- return pendingFlushNum > 0 && queue.isEmpty() &&
lastFlush.elapsedTime().compareTo(flushIntervalMin) > 0;
+ return pendingFlushNum > 0 && queue.isEmpty();
Review comment:
Sure, I changed it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]