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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]