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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to