BILLYisavailable opened a new pull request, #11646:
URL: https://github.com/apache/rocketmq/pull/11646
### Which Issue(s) This PR Fixes
- Fixes #11645
### Brief Description
When async backpressure is enabled, interrupting a sender waiting for
capacity leaves a read lock held. An interrupted byte-capacity wait also loses
the count permit already acquired. Repeated request cancellations reduce send
capacity, and subsequent runtime limit updates can spin indefinitely.
Release each acquisition lock in `finally`, and return acquired permits
before rethrowing `InterruptedException`. Keep the existing exception/callback
behavior. The production change is confined to `executeAsyncMessageSend`.
### How Did You Test This Change?
- Both interruption paths fail on unmodified
`19352a24679337276e041f67307c6d284dd48de9`: the count lock remains held; the
byte case leaves 8 count permits instead of 9 and retains the size lock.
- Four regression tests cover interrupted count/byte waits, the default
async callback overload, and byte-capacity timeout cleanup. They call the
public producer API with real locks, semaphores and threads; a mocked send
executor holds accepted tasks before transport. No live-broker load test is
claimed.
- 85 related tests passed (0 failures, errors or skips), with Checkstyle and
SpotBugs passing:
```sh
mvn -pl client -am \
-Dtest=DefaultMQProducerTest,DefaultMQProducerImplTest,DefaultMQProducerBackpressureTest,TransactionMQProducerWithTraceTest
\
-Dsurefire.failIfNoSpecifiedTests=false \
-Djacoco-maven-plugin.version=0.8.12 test
```
OpenJDK 17, Maven 3.9.11. The command-line JaCoCo override supports JDK 17;
no dependency or build-file changes are included.
--
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]