Skip to content

Conversation

RongtongJin
Copy link
Contributor

Make sure set the target branch to develop

What is the purpose of the change

Fix the bug that the broker will hang after polish the headWaitTimeMills method

#3630
#3509

Brief changelog

  1. Revert the headWaitTimeMills method
  2. Use thread pool isolation to fix the issue of headWaitTimeMills error

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 56.209% when pulling 0623572 on RongtongJin:fix_2516 into e1571ee on apache:develop.

@codecov-commenter
Copy link

Codecov Report

Merging #3631 (0623572) into develop (50d45f2) will increase coverage by 0.89%.
The diff coverage is 60.28%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3631      +/-   ##
=============================================
+ Coverage      48.86%   49.75%   +0.89%     
- Complexity      4659     4733      +74     
=============================================
  Files            555      555              
  Lines          36726    36773      +47     
  Branches        4840     4849       +9     
=============================================
+ Hits           17946    18297     +351     
+ Misses         16532    16195     -337     
- Partials        2248     2281      +33     
Impacted Files Coverage Δ
...cketmq/broker/filter/MessageEvaluationContext.java 30.76% <0.00%> (ø)
...tmq/broker/longpolling/PullRequestHoldService.java 20.48% <0.00%> (ø)
...ocketmq/broker/processor/SendMessageProcessor.java 39.89% <0.00%> (+0.25%) ⬆️
...ocketmq/client/consumer/DefaultMQPushConsumer.java 56.43% <0.00%> (+0.49%) ⬆️
...mq/client/consumer/store/LocalFileOffsetStore.java 56.31% <0.00%> (-0.56%) ⬇️
.../rocketmq/client/impl/ClientRemotingProcessor.java 2.91% <0.00%> (ø)
...java/org/apache/rocketmq/common/Configuration.java 0.00% <0.00%> (ø)
...org/apache/rocketmq/common/message/MessageExt.java 66.66% <0.00%> (-1.57%) ⬇️
...rocketmq/remoting/netty/NettyRemotingAbstract.java 50.91% <0.00%> (-0.19%) ⬇️
...n/java/org/apache/rocketmq/test/util/FileUtil.java 0.00% <0.00%> (ø)
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a5cdfa...0623572. Read the comment docs.

@Override
public void asyncProcessRequest(ChannelHandlerContext ctx, RemotingCommand request, RemotingResponseCallback responseCallback) throws Exception {
asyncProcessRequest(ctx, request).thenAcceptAsync(responseCallback::callback, this.brokerController.getSendMessageExecutor());
asyncProcessRequest(ctx, request).thenAcceptAsync(responseCallback::callback, this.brokerController.getPutMessageFutureExecutor());
Copy link
Contributor

@areyouok areyouok Dec 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback is an async netty operation (ctx.writeAndFlush). I suggest use thenAccept() method, the writeAndFlush may run in these threads:

  1. sendMessageExecutor
  2. the flush thread
  3. the transfer thread

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original method was thenAccept, but it was changed to thenaAcceptAsync because of the issue #1879 #1881

@areyouok areyouok merged commit a2d9424 into apache:develop Dec 15, 2021
@duhenglucky duhenglucky added this to the 4.9.3 milestone Dec 17, 2021
devfat pushed a commit to devfat/rocketmq that referenced this pull request Mar 3, 2022
GenerousMan pushed a commit to GenerousMan/rocketmq that referenced this pull request Aug 12, 2022
carlvine500 pushed a commit to carlvine500/rocketmq-apache that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants