You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "socutes (via GitHub)" <gi...@apache.org> on 2023/03/07 15:57:35 UTC

[GitHub] [rocketmq] socutes opened a new pull request, #6271: ReceiptHandleProcessor message renewal strategy optimization

socutes opened a new pull request, #6271:
URL: https://github.com/apache/rocketmq/pull/6271

   close #6232


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

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130508175


##########
proxy/src/main/java/org/apache/rocketmq/proxy/common/MessageReceiptHandle.java:
##########
@@ -47,6 +49,7 @@ public MessageReceiptHandle(String group, String topic, int queueId, String rece
         this.queueOffset = queueOffset;
         this.reconsumeTimes = reconsumeTimes;
         this.consumeTimestamp = receiptHandle.getRetrieveTime();
+        this.renewStrategyPolicy = new RenewStrategyPolicy();

Review Comment:
   Maybe move the policy to ReceiptHandleProcessor as a static field is better



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

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130504861


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +175,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = messageReceiptHandle.getRenewStrategyPolicy();
                 CompletableFuture<AckResult> future =
                     messagingProcessor.changeInvisibleTime(context, handle, messageReceiptHandle.getMessageId(),
-                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), proxyConfig.getRenewSliceTimeMillis());
+                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), renewPolicy.nextDelayDuration(messageReceiptHandle.getRenewRetryTimes()));

Review Comment:
   We need another counter to save the renew times
   The retry times will be increased when some error occur, and will reset to 0 after success



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

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


[GitHub] [rocketmq] drpmma commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "drpmma (via GitHub)" <gi...@apache.org>.
drpmma commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130532397


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +175,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = messageReceiptHandle.getRenewStrategyPolicy();
                 CompletableFuture<AckResult> future =
                     messagingProcessor.changeInvisibleTime(context, handle, messageReceiptHandle.getMessageId(),
-                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), proxyConfig.getRenewSliceTimeMillis());
+                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), renewPolicy.nextDelayDuration(messageReceiptHandle.getRenewRetryTimes()));

Review Comment:
   The renew times have no relationship with retry times.



##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -192,7 +193,7 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                         messageReceiptHandle.resetRenewRetryTimes();
                         resFuture.complete(messageReceiptHandle);
                     } else {
-                        log.error("renew response is not ok. result:{}, handle:{}", ackResult, messageReceiptHandle, throwable);
+                        log.error("renew response is not ok. result:{}", ackResult, messageReceiptHandle);

Review Comment:
   The throwable argument is missing for log.error



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

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


[GitHub] [rocketmq] socutes commented on pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "socutes (via GitHub)" <gi...@apache.org>.
socutes commented on PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#issuecomment-1459036192

   @xdkxlk @drpmma @zhouxinyu PTAL


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

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


[GitHub] [rocketmq] drpmma commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "drpmma (via GitHub)" <gi...@apache.org>.
drpmma commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130532397


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +175,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = messageReceiptHandle.getRenewStrategyPolicy();
                 CompletableFuture<AckResult> future =
                     messagingProcessor.changeInvisibleTime(context, handle, messageReceiptHandle.getMessageId(),
-                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), proxyConfig.getRenewSliceTimeMillis());
+                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), renewPolicy.nextDelayDuration(messageReceiptHandle.getRenewRetryTimes()));

Review Comment:
   The renew time has no relationship with retry times. The retry time is about message consumption failure while the renew time is about splitting time from invisible time.



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

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


[GitHub] [rocketmq] socutes commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "socutes (via GitHub)" <gi...@apache.org>.
socutes commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1131104870


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -192,7 +193,7 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                         messageReceiptHandle.resetRenewRetryTimes();
                         resFuture.complete(messageReceiptHandle);
                     } else {
-                        log.error("renew response is not ok. result:{}, handle:{}", ackResult, messageReceiptHandle, throwable);
+                        log.error("renew response is not ok. result:{}", ackResult, messageReceiptHandle);

Review Comment:
   > The throwable argument is missing for log.error
   
   In this judgment condition, the throwable is always empty, so no record is required.



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

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


[GitHub] [rocketmq] socutes commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "socutes (via GitHub)" <gi...@apache.org>.
socutes commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1133830959


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +176,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = new RenewStrategyPolicy();

Review Comment:
   > Changing the RenewStrategyPolicy to `static final` can be better
   
   @xdkxlk Thanks,This problem has been modified. 



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

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


[GitHub] [rocketmq] socutes commented on pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "socutes (via GitHub)" <gi...@apache.org>.
socutes commented on PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#issuecomment-1463021776

   @xdkxlk @drpmma PTAL, Thanks


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

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


[GitHub] [rocketmq] socutes commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "socutes (via GitHub)" <gi...@apache.org>.
socutes commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1133830959


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +176,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = new RenewStrategyPolicy();

Review Comment:
   > Changing the RenewStrategyPolicy to `static final` can be better
   
   Thanks,This problem has been modified. 



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

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1133490044


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +176,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = new RenewStrategyPolicy();

Review Comment:
   Changing the RenewStrategyPolicy to `static final` can be better



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

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


[GitHub] [rocketmq] zhouxinyu merged pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "zhouxinyu (via GitHub)" <gi...@apache.org>.
zhouxinyu merged PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271


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

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


[GitHub] [rocketmq] codecov-commenter commented on pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#issuecomment-1458495888

   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#6271](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e23107f) into [develop](https://codecov.io/gh/apache/rocketmq/commit/236d4a164e4ba0a6d1d5db4c25225224ab206c5e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (236d4a1) will **increase** coverage by `0.06%`.
   > The diff coverage is `50.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #6271      +/-   ##
   =============================================
   + Coverage      43.17%   43.24%   +0.06%     
   - Complexity      8849     8863      +14     
   =============================================
     Files           1094     1095       +1     
     Lines          77192    77219      +27     
     Branches       10068    10069       +1     
   =============================================
   + Hits           33331    33390      +59     
   + Misses         39691    39666      -25     
   + Partials        4170     4163       -7     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rg/apache/rocketmq/common/message/MessageType.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vbWVzc2FnZS9NZXNzYWdlVHlwZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...che/rocketmq/proxy/common/RenewStrategyPolicy.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Byb3h5L2NvbW1vbi9SZW5ld1N0cmF0ZWd5UG9saWN5LmphdmE=) | `45.83% <45.83%> (ø)` | |
   | [.../org/apache/rocketmq/proxy/config/ProxyConfig.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Byb3h5L2NvbmZpZy9Qcm94eUNvbmZpZy5qYXZh) | `44.86% <50.00%> (ø)` | |
   | [...cketmq/proxy/processor/ReceiptHandleProcessor.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Byb3h5L3Byb2Nlc3Nvci9SZWNlaXB0SGFuZGxlUHJvY2Vzc29yLmphdmE=) | `69.66% <66.66%> (+0.17%)` | :arrow_up: |
   | [...he/rocketmq/proxy/common/MessageReceiptHandle.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Byb3h5L2NvbW1vbi9NZXNzYWdlUmVjZWlwdEhhbmRsZS5qYXZh) | `73.58% <100.00%> (+1.03%)` | :arrow_up: |
   | [...proxy/grpc/v2/consumer/ReceiveMessageActivity.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Byb3h5L2dycGMvdjIvY29uc3VtZXIvUmVjZWl2ZU1lc3NhZ2VBY3Rpdml0eS5qYXZh) | `73.41% <100.00%> (ø)` | |
   | [...tmq/remoting/protocol/body/ConsumerConnection.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL3Byb3RvY29sL2JvZHkvQ29uc3VtZXJDb25uZWN0aW9uLmphdmE=) | `95.83% <0.00%> (-4.17%)` | :arrow_down: |
   | [...etmq/namesrv/processor/ClientRequestProcessor.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bmFtZXNydi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbmFtZXNydi9wcm9jZXNzb3IvQ2xpZW50UmVxdWVzdFByb2Nlc3Nvci5qYXZh) | `76.31% <0.00%> (-2.64%)` | :arrow_down: |
   | [...ache/rocketmq/store/AllocateMappedFileService.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL0FsbG9jYXRlTWFwcGVkRmlsZVNlcnZpY2UuamF2YQ==) | `39.28% <0.00%> (-2.39%)` | :arrow_down: |
   | [...rocketmq/common/message/MessageClientIDSetter.java](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vbWVzc2FnZS9NZXNzYWdlQ2xpZW50SURTZXR0ZXIuamF2YQ==) | `71.42% <0.00%> (-2.39%)` | :arrow_down: |
   | ... and [30 more](https://codecov.io/gh/apache/rocketmq/pull/6271?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130504861


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +175,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = messageReceiptHandle.getRenewStrategyPolicy();
                 CompletableFuture<AckResult> future =
                     messagingProcessor.changeInvisibleTime(context, handle, messageReceiptHandle.getMessageId(),
-                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), proxyConfig.getRenewSliceTimeMillis());
+                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), renewPolicy.nextDelayDuration(messageReceiptHandle.getRenewRetryTimes()));

Review Comment:
   We need another counter to save the renew times
   The retry times will be increased when some error occur, and will be reseted to 0 after success



##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +175,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = messageReceiptHandle.getRenewStrategyPolicy();
                 CompletableFuture<AckResult> future =
                     messagingProcessor.changeInvisibleTime(context, handle, messageReceiptHandle.getMessageId(),
-                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), proxyConfig.getRenewSliceTimeMillis());
+                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), renewPolicy.nextDelayDuration(messageReceiptHandle.getRenewRetryTimes()));

Review Comment:
   We need another counter to save the renew times
   The retry times will be increased when some error occur, and will be reset to 0 after success



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

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130511232


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -192,7 +193,7 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                         messageReceiptHandle.resetRenewRetryTimes();
                         resFuture.complete(messageReceiptHandle);
                     } else {
-                        log.error("renew response is not ok. result:{}, handle:{}", ackResult, messageReceiptHandle, throwable);
+                        log.error("renew response is not ok. result:{}", ackResult, messageReceiptHandle);

Review Comment:
   The format is not right, a `{}` is missing here



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

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