bajiaoshan opened a new pull request, #16534:
URL: https://github.com/apache/dubbo/pull/16534
## What is the purpose of the change?
Cancelling a `DefaultFuture` after a previous cancellation, response, or
timeout throws `NullPointerException`: the request is no longer in `FUTURES`,
but `cancel()` passes the null map-removal result to executor cleanup.
Cancellation from a response completion callback fails for the same reason.
Perform executor cleanup using the owning future (`this`). Continue removing
the request and channel entries and cancelling the timeout task. Add four
deterministic regression tests that also verify executor shutdown, cleared
request/channel state, and preservation of existing success/timeout results.
Fixes #16533.
## Validation
- Before the production fix, all four new scenarios reproduce the null
dereference (three assertion failures and one exceptional completion).
- After the fix, all four pass. The selected exchange/future tests discover
89 cases: 84 pass, five existing disabled tests are skipped, and there are no
failures or errors.
- All nine modules in the dependency reactor build successfully.
- Local JaCoCo confirms both modified executable lines are fully covered.
- Checkstyle and Spotless pass; `git diff --check` passes. The Unix
line-ending check is skipped on Windows.
Focused regression command:
```sh
./mvnw -pl dubbo-remoting/dubbo-remoting-api -am \
'-Dtest=DefaultFutureTest#testRepeatedCancel+testCancelAfterResponse+testCancelAfterTimeout+testCancelFromCompletionCallback'
\
-Dsurefire.failIfNoSpecifiedTests=false test
```
Broader validation uses `-Dtest=DefaultFutureTest,*Exchange*Test` with
JaCoCo enabled. Full-project and external-service integration tests have not
been run locally.
## Checklist
- [x] Link the corresponding GitHub issue.
- [x] Describe the problem, root cause and fix.
- [x] Add regression tests that fail before the fix and pass afterward.
- [ ] Verify upstream GitHub Actions after submission.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]