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 03:40:59 UTC

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

ni-ze commented on a change in pull request #3828:
URL: https://github.com/apache/rocketmq/pull/3828#discussion_r804339645



##########
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:
       replace 
   ```java
   HAService.this.defaultMessageStore.getSystemClock().now() + req.getTimeoutMillis()
   ```
   with deadLine is not necessary and recommended.
   




-- 
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