You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "beemines (via GitHub)" <gi...@apache.org> on 2026/09/08 08:17:10 UTC
[PR] fix: release concurrency slots on downstream limit exceptions [dubbo]
beemines opened a new pull request, #16456:
URL: https://github.com/apache/dubbo/pull/16456
## What is the purpose of the change?
Fixes #16455.
`ActiveLimitFilter` and `ExecuteLimitFilter` skip error accounting for every `LIMIT_EXCEEDED_EXCEPTION`. If a downstream invoker throws that exception after admission, or completes its result future exceptionally with it, the acquired concurrency slot is never released. At a limit of 1, later calls can time out or be rejected despite no call remaining in flight.
Track whether each filter acquired a slot during the current invocation attempt. Only locally rejected limit exceptions skip accounting; downstream limit exceptions release the slot through the existing error callback. Scope each marker by the target URL identity (also used by RpcStatus), since forking calls can share an Invocation across providers. Reset the marker on entry so sequential reuse does not reuse a previous admission decision. Existing timing, wakeup, successful-response, and non-limit-error handling are preserved.
The regression tests use the production `CopyOfFilterChainNode` and `CallbackRegistrationInvoker` lifecycle with local mock invokers and controllable futures. For both filters they verify synchronous downstream rejection, asynchronous exceptional completion, local rejection while another call remains active, sequential invocation reuse, and target isolation when two invokers share the same Invocation.
## Verification
JDK 17.0.17, Maven 3.9.4, Windows; the project's Java 8 artifact target is unchanged.
```shell
./mvnw -B -pl dubbo-cluster -am \
-Dtest=LimitFilterSlotReleaseTest,ActiveLimitFilterTest,ExecuteLimitFilterTest,RpcStatusTest,DefaultFilterChainBuilderTest \
-Dsurefire.failIfNoSpecifiedTests=false test
./mvnw -B -pl dubbo-cluster -am -Pcheckstyle \
-Dcheckstyle_unix.skip=true '-DspotlessFiles=.*Limit.*java' validate spotless:check
```
- Before the fix on `dab47b7843`: 8 new regression cases, 4 assertion failures, 0 errors. Both filters retain an active count of 1 after synchronous/asynchronous downstream limit errors. The local-rejection controls pass.
- After the final fix: all 26 selected tests pass, including 10 new cases; 0 failures, errors, or skips. The two additional cases verify that different targets sharing an Invocation retain separate admission state.
- Java Checkstyle reports 0 violations across the selected reactor; Spotless reports no changes needed for the checked limit-related files, and git diff --check is clean.
On this Windows checkout, the initial Unix resource-line-ending check reports 59 pre-existing CRLF resource files due to core.autocrlf=true. The separate Unix check was disabled locally for subsequent validation; no unrelated resources were modified. All three changed Java files use LF. The final test run also enabled Java Checkstyle and applied Spotless without further changes.
The regression targets exceptions delivered to `onError`, not business exceptions carried inside a normally completed `AppResponse`. No registry or external RPC service is required. The full repository test suite was not run.
AI assistance was used for investigation, code, and tests. The failing behavior was reproduced locally before applying the production fix.
## Checklist
- [x] A GitHub issue describes the change: #16455.
- [x] The description explains the problem, behavior, and implementation.
- [x] Regression tests cover the fix and admission controls.
- [ ] GitHub Actions pass (pending upstream execution).
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix: release concurrency slots on downstream limit exceptions [dubbo]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16456:
URL: https://github.com/apache/dubbo/pull/16456#issuecomment-5582035431
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/16456?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `11 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 29.80%. Comparing base ([`dab47b7`](https://app.codecov.io/gh/apache/dubbo/commit/dab47b78434ae36957c196c65c0c805fc36b7f66?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3783a07`](https://app.codecov.io/gh/apache/dubbo/commit/3783a07308c4ba3d266cd5baaca9818009b19212?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/16456?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...rg/apache/dubbo/rpc/filter/ExecuteLimitFilter.java](https://app.codecov.io/gh/apache/dubbo/pull/16456?src=pr&el=tree&filepath=dubbo-rpc%2Fdubbo-rpc-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Frpc%2Ffilter%2FExecuteLimitFilter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvRXhlY3V0ZUxpbWl0RmlsdGVyLmphdmE=) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...org/apache/dubbo/rpc/filter/ActiveLimitFilter.java](https://app.codecov.io/gh/apache/dubbo/pull/16456?src=pr&el=tree&filepath=dubbo-rpc%2Fdubbo-rpc-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Frpc%2Ffilter%2FActiveLimitFilter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvQWN0aXZlTGltaXRGaWx0ZXIuamF2YQ==) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (dab47b7) and HEAD (3783a07). Click for more details.
>
> <details><summary>HEAD has 8 uploads less than BASE</summary>
>
>| Flag | BASE (dab47b7) | HEAD (3783a07) |
>|------|------|------|
>|unit-tests-java17|1|0|
>|unit-tests-java8|1|0|
>|samples-tests-java21|1|0|
>|integration-tests-java8|1|0|
>|integration-tests-java21|1|0|
>|unit-tests-java11|1|0|
>|unit-tests-java25|1|0|
>|unit-tests-java21|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.3 #16456 +/- ##
=============================================
- Coverage 60.91% 29.80% -31.12%
- Complexity 15 9434 +9419
=============================================
Files 1953 1952 -1
Lines 89271 89258 -13
Branches 13473 13391 -82
=============================================
- Hits 54383 26605 -27778
- Misses 29309 58529 +29220
+ Partials 5579 4124 -1455
```
| [Flag](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.80% <0.00%> (-0.03%)` | :arrow_down: |
| [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java25](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16456/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo/pull/16456?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org