You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/02/11 08:33:05 UTC

[GitHub] [rocketmq] areyouok commented on a change in pull request #3828: [ISSUE #3827]Improve Performance of Transactional Message

areyouok commented on a change in pull request #3828:
URL: https://github.com/apache/rocketmq/pull/3828#discussion_r804441408



##########
File path: store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
##########
@@ -287,17 +287,12 @@ private void doWaitTransfer() {
             if (!this.requestsRead.isEmpty()) {
                 for (CommitLog.GroupCommitRequest req : this.requestsRead) {
                     boolean transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset();
-                    long waitUntilWhen = HAService.this.defaultMessageStore.getSystemClock().now()
-                            + HAService.this.defaultMessageStore.getMessageStoreConfig().getSyncFlushTimeout();
-                    while (!transferOK && HAService.this.defaultMessageStore.getSystemClock().now() < waitUntilWhen) {
+                    long deadLine = req.getDeadLine();
+                    while (!transferOK && deadLine - System.nanoTime() > 0) {

Review comment:
       nanoTIme() is better than currentTimeMillis() for measure elapsed time. currentTimeMillis() may affect by system clock  adjustment, and cause unexpected result.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org