ai-yang opened a new pull request, #10986:
URL: https://github.com/apache/rocketmq/pull/10986
### Which Issue(s) This PR Fixes
- Fixes #10985
### Brief Description
`PopReviveService` records a checkpoint as in flight, schedules asynchronous
business-message reads, and then advances the revive offset. If one read
completes exceptionally, `allOf(...).whenComplete(...)` runs but
`future.getNow(...)` throws `CompletionException`. This aborts the callback
before it rewrites the checkpoint or clears the in-flight entry. Since timeout
cleanup only runs while the map contains more than three entries, a low-traffic
failure can lose the message's retry path indefinitely.
This change:
- handles exceptional completion of the upstream `getBizMessage` future;
- logs the failed topic, queue, offset, and broker context;
- converts the failed read to `(msgOffset, false)`, allowing the existing
`rePutCK` path to retain retryability;
- deliberately does not catch exceptions raised later by `reviveRetry`,
keeping the change scoped to asynchronous reads;
- adds a regression asserting that the original offset is committed, a
replacement CK is written, and the in-flight entry is removed.
There is no protocol, storage-format, or public API change.
### How Did You Test This Change?
The new deterministic test makes `EscapeBridge.getMessageAsync` return an
exceptionally completed future. On unmodified `develop` at `e348efa66`, two
independent runs reproduced the same failure:
```text
reviveObj.newOffset = 1
committed revive offset = 1
inflightReviveRequestMap.size() = 1
expected messageStore.putMessage(rewritten CK): 1
actual: 0
```
With this change, the complete `PopReviveServiceTest` class passes:
```text
Tests run: 13, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
```
Command:
```bash
mvn -o -Dmaven.repo.local=/developer/wangrui/.m2/repository \
-pl broker -am -DskipITs \
-Dcheckstyle.skip -Dspotbugs.skip -Drat.skip \
-Dsurefire.failIfNoSpecifiedTests=false \
-Dtest=PopReviveServiceTest test
```
The broker reactor verification also passes with Checkstyle and SpotBugs
enabled:
```text
Checkstyle: 0 violations
SpotBugs: 0 bug instances, 0 errors
BUILD SUCCESS
```
`git diff --check` passes as well.
--
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]