You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qianye1001 (via GitHub)" <gi...@apache.org> on 2024/09/12 03:10:45 UTC

[PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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

   2. fix go away
   
   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #8599 
   
   1.    Reconnect condition may not be satisfied when rolling update proxy because of the reconnect interval 60 seconds
   2.   Sending retry request without extFields may fail
   
   ### Brief Description
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   1.  Fix send fail with receiving GO_AWAY when rolling update proxy
   3. Add channel id in logs
   4. Send retry request with extFields when receiving GO_AWAY
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   


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


Re: [PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java:
##########
@@ -819,21 +816,23 @@ public CompletableFuture<ResponseFuture> invokeImpl(final Channel channel, final
             RemotingCommand response = responseFuture.getResponseCommand();
             if (response.getCode() == ResponseCode.GO_AWAY) {
                 if (nettyClientConfig.isEnableReconnectForGoAway()) {
+                    LOGGER.info("Receive go away from channelId={}, channel={}", channel.id(), channel);
                     ChannelWrapper channelWrapper = channelWrapperTables.computeIfPresent(channel, (channel0, channelWrapper0) -> {
                         try {
-                            if (channelWrapper0.reconnect()) {
-                                LOGGER.info("Receive go away from channel {}, recreate the channel", channel0);
+                            if (channelWrapper0.reconnect(channel0)) {
+                                LOGGER.info("Receive go away from channelId={}, channel={}, recreate the channelId={}", channel0.id(), channel0, channelWrapper0.getChannel().id());
                                 channelWrapperTables.put(channelWrapper0.getChannel(), channelWrapper0);
                             }
                         } catch (Throwable t) {
                             LOGGER.error("Channel {} reconnect error", channelWrapper0, t);
                         }
                         return channelWrapper0;
                     });
-                    if (channelWrapper != null) {
+                    if (channelWrapper != null && !channelWrapper.isWrapperOf(channel)) {
                         if (nettyClientConfig.isEnableTransparentRetry()) {
                             RemotingCommand retryRequest = RemotingCommand.createRequestCommand(request.getCode(), request.readCustomHeader());
                             retryRequest.setBody(request.getBody());
+                            retryRequest.setExtFields(request.getExtFields());

Review Comment:
   ...



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


Re: [PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/8685?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `36.36364%` with `21 lines` in your changes missing coverage. Please review.
   > Project coverage is 47.48%. Comparing base [(`4c51706`)](https://app.codecov.io/gh/apache/rocketmq/commit/4c51706b28c192c647e186a65aec8d690f9b30f9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`581f08f`)](https://app.codecov.io/gh/apache/rocketmq/commit/581f08f5df5b670eb56d0ebe3598f80e4d6db82b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 13 commits behind head on develop.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq/pull/8685?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...e/rocketmq/remoting/netty/NettyRemotingClient.java](https://app.codecov.io/gh/apache/rocketmq/pull/8685?src=pr&el=tree&filepath=remoting%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fremoting%2Fnetty%2FNettyRemotingClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL25ldHR5L05ldHR5UmVtb3RpbmdDbGllbnQuamF2YQ==) | 35.48% | [17 Missing and 3 partials :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/8685?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...rocketmq/remoting/netty/NettyRemotingAbstract.java](https://app.codecov.io/gh/apache/rocketmq/pull/8685?src=pr&el=tree&filepath=remoting%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fremoting%2Fnetty%2FNettyRemotingAbstract.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL25ldHR5L05ldHR5UmVtb3RpbmdBYnN0cmFjdC5qYXZh) | 50.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/8685?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #8685      +/-   ##
   =============================================
   + Coverage      47.27%   47.48%   +0.21%     
   - Complexity     11488    11528      +40     
   =============================================
     Files           1277     1277              
     Lines          89425    89453      +28     
     Branches       11502    11504       +2     
   =============================================
   + Hits           42272    42478     +206     
   + Misses         41948    41758     -190     
   - Partials        5205     5217      +12     
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/8685?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


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


Re: [PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java:
##########
@@ -819,21 +816,23 @@ public CompletableFuture<ResponseFuture> invokeImpl(final Channel channel, final
             RemotingCommand response = responseFuture.getResponseCommand();
             if (response.getCode() == ResponseCode.GO_AWAY) {
                 if (nettyClientConfig.isEnableReconnectForGoAway()) {
+                    LOGGER.info("Receive go away from channelId={}, channel={}", channel.id(), channel);
                     ChannelWrapper channelWrapper = channelWrapperTables.computeIfPresent(channel, (channel0, channelWrapper0) -> {
                         try {
-                            if (channelWrapper0.reconnect()) {
-                                LOGGER.info("Receive go away from channel {}, recreate the channel", channel0);
+                            if (channelWrapper0.reconnect(channel0)) {
+                                LOGGER.info("Receive go away from channelId={}, channel={}, recreate the channelId={}", channel0.id(), channel0, channelWrapper0.getChannel().id());
                                 channelWrapperTables.put(channelWrapper0.getChannel(), channelWrapper0);
                             }
                         } catch (Throwable t) {
                             LOGGER.error("Channel {} reconnect error", channelWrapper0, t);
                         }
                         return channelWrapper0;
                     });
-                    if (channelWrapper != null) {
+                    if (channelWrapper != null && !channelWrapper.isWrapperOf(channel)) {
                         if (nettyClientConfig.isEnableTransparentRetry()) {
                             RemotingCommand retryRequest = RemotingCommand.createRequestCommand(request.getCode(), request.readCustomHeader());
                             retryRequest.setBody(request.getBody());
+                            retryRequest.setExtFields(request.getExtFields());

Review Comment:
   ... acl rely on this properties



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


Re: [PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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


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


Re: [PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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

   @drpmma


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


Re: [PR] [ISSUE #8599] Fix send fail with receiving GO_AWAY when rolling update proxy and add channel id in logs [rocketmq]

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


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java:
##########
@@ -819,21 +816,23 @@ public CompletableFuture<ResponseFuture> invokeImpl(final Channel channel, final
             RemotingCommand response = responseFuture.getResponseCommand();
             if (response.getCode() == ResponseCode.GO_AWAY) {
                 if (nettyClientConfig.isEnableReconnectForGoAway()) {
+                    LOGGER.info("Receive go away from channelId={}, channel={}", channel.id(), channel);
                     ChannelWrapper channelWrapper = channelWrapperTables.computeIfPresent(channel, (channel0, channelWrapper0) -> {
                         try {
-                            if (channelWrapper0.reconnect()) {
-                                LOGGER.info("Receive go away from channel {}, recreate the channel", channel0);
+                            if (channelWrapper0.reconnect(channel0)) {
+                                LOGGER.info("Receive go away from channelId={}, channel={}, recreate the channelId={}", channel0.id(), channel0, channelWrapper0.getChannel().id());
                                 channelWrapperTables.put(channelWrapper0.getChannel(), channelWrapper0);
                             }
                         } catch (Throwable t) {
                             LOGGER.error("Channel {} reconnect error", channelWrapper0, t);
                         }
                         return channelWrapper0;
                     });
-                    if (channelWrapper != null) {
+                    if (channelWrapper != null && !channelWrapper.isWrapperOf(channel)) {
                         if (nettyClientConfig.isEnableTransparentRetry()) {
                             RemotingCommand retryRequest = RemotingCommand.createRequestCommand(request.getCode(), request.readCustomHeader());
                             retryRequest.setBody(request.getBody());
+                            retryRequest.setExtFields(request.getExtFields());

Review Comment:
   ... acl rely this properties



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