You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qianye1001 (via GitHub)" <gi...@apache.org> on 2026/07/23 12:16:37 UTC
[PR] [Java] Improve gRPC transport resilience [rocketmq-clients]
qianye1001 opened a new pull request, #1310:
URL: https://github.com/apache/rocketmq-clients/pull/1310
### Which Issue(s) This PR Fixes
Fixes #1309
### Brief Description
This change improves two Java gRPC client failure paths:
- Normalize transport-level gRPC `RESOURCE_EXHAUSTED` failures to `TooManyRequestsException`, so producer retries use the existing throttling backoff instead of retrying immediately.
- Recover a potentially half-open transport from the heartbeat path. `UNAVAILABLE` triggers recovery immediately, while two consecutive `DEADLINE_EXCEEDED` heartbeat failures trigger recovery after filtering a transient timeout.
Transport recovery calls `ManagedChannel.enterIdle()` so the next RPC creates a new transport without replacing the whole `RpcClient` or disrupting ordinary send failures. Any successful heartbeat resets the timeout counter, non-connectivity failures such as `RESOURCE_EXHAUSTED` do not trigger recovery, and a 30-second cooldown prevents reconnect storms.
### How Did You Test This Change?
Using JDK 11:
```text
mvn -pl client -am -DskipITs test
```
Result: 281 tests run, 0 failures, 0 errors, 1 skipped.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Java] Improve gRPC transport resilience [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #1310:
URL: https://github.com/apache/rocketmq-clients/pull/1310#issuecomment-5113880612
Java gRPC 客户端在 TCP 连接变为"半开"(half-open)状态时(如网络黑洞、中间设备静默丢包),恢复时间极长。旧实现依赖 gRPC keepalive 机制(默认 300s keepalive + 30s timeout),导致恢复需要 ~330 秒。
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Java] Improve gRPC transport resilience [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #1310:
URL: https://github.com/apache/rocketmq-clients/pull/1310
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Java] Improve gRPC transport resilience [rocketmq-clients]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1310:
URL: https://github.com/apache/rocketmq-clients/pull/1310#issuecomment-5058297822
## [Codecov](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310?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 `80.70175%` with `11 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 53.91%. Comparing base ([`4076e2b`](https://app.codecov.io/gh/apache/rocketmq-clients/commit/4076e2b1d9979079c228aa52bfc8fa6dd874fa3b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`9c22cb1`](https://app.codecov.io/gh/apache/rocketmq-clients/commit/9c22cb1fffae565dab1eb12e907b4a0a78f0da92?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 155 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...e/rocketmq/client/java/impl/ClientManagerImpl.java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310?src=pr&el=tree&filepath=java%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fjava%2Fimpl%2FClientManagerImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-amF2YS9jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2NsaWVudC9qYXZhL2ltcGwvQ2xpZW50TWFuYWdlckltcGwuamF2YQ==) | 78.04% | [8 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...org/apache/rocketmq/client/java/rpc/RpcFuture.java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310?src=pr&el=tree&filepath=java%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fjava%2Frpc%2FRpcFuture.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-amF2YS9jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2NsaWVudC9qYXZhL3JwYy9ScGNGdXR1cmUuamF2YQ==) | 85.71% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1310 +/- ##
============================================
+ Coverage 53.26% 53.91% +0.64%
- Complexity 651 798 +147
============================================
Files 208 221 +13
Lines 14303 14533 +230
Branches 5845 5585 -260
============================================
+ Hits 7619 7835 +216
+ Misses 6308 6295 -13
- Partials 376 403 +27
```
| [Flag](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1310/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `62.58% <80.70%> (+0.90%)` | :arrow_up: |
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/rocketmq-clients/pull/1310?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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org