Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1433#discussion_r130570911
--- Diff:
artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
---
@@ -386,17 +383,22 @@ public void run() {
if (pendingSync) {
if (useSleep) {
// if using sleep, we will always flush
- flush();
lastFlushTime = System.nanoTime();
+ flush();
+
} else if (bufferObserver != null && System.nanoTime() >
lastFlushTime + timeout) {
+ lastFlushTime = System.nanoTime();
// if not using flush we will spin and do the time
checks manually
flush();
- lastFlushTime = System.nanoTime();
}
}
-
- sleepIfPossible();
+ //it could wait until the timeout is expired
+ final long timeFromTheLastFlush = System.nanoTime() -
lastFlushTime;
+ final long timeToSleep = timeFromTheLastFlush - timeout;
--- End diff --
You are basically discounting the time it took to sync?
looks good!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---