You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "mxsm (via GitHub)" <gi...@apache.org> on 2023/05/13 14:45:45 UTC

[GitHub] [rocketmq] mxsm opened a new pull request, #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print

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

   <!-- 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 #6748 
   
   ### Brief Description
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   - Optimize NettyRemotingAbstract#writeResponse log print
   
   ### 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


[GitHub] [rocketmq] mxsm commented on a diff in pull request #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print

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


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java:
##########
@@ -216,10 +216,7 @@ public static void writeResponse(Channel channel, RemotingCommand request, @Null
         response.markResponseType();
         try {
             channel.writeAndFlush(response).addListener((ChannelFutureListener) future -> {
-                if (future.isSuccess()) {
-                    log.debug("Response[request code: {}, response code: {}, opaque: {}] is written to channel{}",
-                        request.getCode(), response.getCode(), response.getOpaque(), channel);

Review Comment:
   > The log level is debug, but it also affects performance, right?
   
   This is the place I noticed when generating memory allocation flame graphs with async-profiler while performing stress testing with JMeter. However, I don’t seem to have found any log printing for debug configuration.



-- 
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] RongtongJin commented on a diff in pull request #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print

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


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java:
##########
@@ -216,10 +216,7 @@ public static void writeResponse(Channel channel, RemotingCommand request, @Null
         response.markResponseType();
         try {
             channel.writeAndFlush(response).addListener((ChannelFutureListener) future -> {
-                if (future.isSuccess()) {
-                    log.debug("Response[request code: {}, response code: {}, opaque: {}] is written to channel{}",
-                        request.getCode(), response.getCode(), response.getOpaque(), channel);

Review Comment:
   The log level is debug, but it also affects performance, right?



-- 
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] mxsm closed pull request #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm closed pull request #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print
URL: https://github.com/apache/rocketmq/pull/6750


-- 
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 #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print

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

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/6750?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#6750](https://app.codecov.io/gh/apache/rocketmq/pull/6750?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (ecb07ff) into [develop](https://app.codecov.io/gh/apache/rocketmq/commit/9d411cf04a695e7a3f41036e8377b0aa544d754d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (9d411cf) will **decrease** coverage by `0.03%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #6750      +/-   ##
   =============================================
   - Coverage      42.85%   42.83%   -0.03%     
   + Complexity      9002     8997       -5     
   =============================================
     Files           1113     1113              
     Lines          78615    78613       -2     
     Branches       10229    10229              
   =============================================
   - Hits           33692    33673      -19     
   - Misses         40701    40706       +5     
   - Partials        4222     4234      +12     
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/rocketmq/pull/6750?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...rocketmq/remoting/netty/NettyRemotingAbstract.java](https://app.codecov.io/gh/apache/rocketmq/pull/6750?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL25ldHR5L05ldHR5UmVtb3RpbmdBYnN0cmFjdC5qYXZh) | `51.29% <0.00%> (-0.64%)` | :arrow_down: |
   
   ... and [20 files with indirect coverage changes](https://app.codecov.io/gh/apache/rocketmq/pull/6750/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :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=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


[GitHub] [rocketmq] ferrirW commented on a diff in pull request #6750: [ISSUE #6748]Optimize NettyRemotingAbstract#writeResponse log print

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


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java:
##########
@@ -216,10 +216,7 @@ public static void writeResponse(Channel channel, RemotingCommand request, @Null
         response.markResponseType();
         try {
             channel.writeAndFlush(response).addListener((ChannelFutureListener) future -> {
-                if (future.isSuccess()) {
-                    log.debug("Response[request code: {}, response code: {}, opaque: {}] is written to channel{}",
-                        request.getCode(), response.getCode(), response.getOpaque(), channel);

Review Comment:
   It looks like the problem is the string concatenation, add log.isDebugEnabled should reduce the affect on performance.



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