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 2019/10/17 05:43:30 UTC

[GitHub] [rocketmq] CodeIngL commented on a change in pull request #1536: [ISSUE #1535] Fix ha sync transfer timeout

CodeIngL commented on a change in pull request #1536: [ISSUE #1535] Fix ha sync transfer timeout
URL: https://github.com/apache/rocketmq/pull/1536#discussion_r335817655
 
 

 ##########
 File path: store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
 ##########
 @@ -280,9 +280,14 @@ private void doWaitTransfer() {
                 if (!this.requestsRead.isEmpty()) {
                     for (CommitLog.GroupCommitRequest req : this.requestsRead) {
                         boolean transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset();
-                        for (int i = 0; !transferOK && i < 5; i++) {
+                        long waitUntillWhen = HAService.this.defaultMessageStore.getSystemClock().now()
+                            + HAService.this.defaultMessageStore.getMessageStoreConfig().getSyncFlushTimeout();
+                        while (HAService.this.defaultMessageStore.getSystemClock().now() < waitUntillWhen) {
 
 Review comment:
   you should check transferok to reduce unnecessary block。

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services