guyinyou opened a new pull request, #1371:
URL: https://github.com/apache/rocketmq-clients/pull/1371

   ### Which Issue(s) This PR Fixes
   
   Aligns the C# SDK with the recovery behavior introduced by the **Java 
reference implementation: [PR 
#1310](https://github.com/apache/rocketmq-clients/pull/1310)** (commit 
`9fe1449d19449b41442aa3a97ab168ed6b5bd6b1`).
   
   ### Brief Description
   
   A half-open TCP connection can still appear healthy to gRPC while every 
request times out. This change adds heartbeat-driven transport recovery rather 
than resetting connections for ordinary RPC failures.
   
   - Recover after two consecutive heartbeat `DeadlineExceeded` failures, or 
`Unavailable` while the channel remains `Ready`. Apply a per-endpoint 30-second 
cooldown; server `ReconnectEndpointsCommand` bypasses the cooldown but shares 
recovery exclusion.
   - Rebuild telemetry and resynchronize settings, preserving valid EOF renewal 
requests under contention. Prevent late callbacks, route 
retirement/re-addition, and shutdown races from reviving obsolete sessions; 
contain cancellation failures in command replies.
   - Normalize transport `ResourceExhausted` to `TooManyRequestsException`, 
preserving the request ID and original exception. Add regression coverage and 
install the .NET 10 SDK required by the existing project targets in CI.
   
   **C# adaptations:** grpc-dotnet has no equivalent of Java's `enterIdle()`, 
so recovery replaces the handler, channel, and stub, then disposes the old 
transport. `SocketsHttpHandler` enables connectivity-state inspection, and 
`DisposeHttpClient = true` ensures handler ownership. Heartbeat results are 
processed in registration order; expensive recovery runs outside bookkeeping 
locks. Transport recovery and telemetry renewal have separate concurrency 
guards.
   
   **Compatibility:** `IClientManager` adds `Reconnect(Endpoints)`; 
`IRpcClient` adds `State` and `ResetTransport()`. External implementations must 
supply these members when upgrading. SDK-provided implementations need no 
caller changes. The existing `RpcClient.Shutdown()` behavior and gRPC package 
versions are unchanged.
   
   ### How Did You Test This Change?
   
   Verified locally on **macOS arm64**:
   
   - [x] Build the solution for `net8.0` and `net10.0`: zero warnings/errors.
   - [x] `dotnet format style --verify-no-changes`.
   - [x] Full `net10.0` suite: **226/226 passed in each of three consecutive 
runs**.
   - [x] Independently run ClientManager, Client, Session, consumer recovery, 
isolated exception, resource-leak, and half-open TCP test groups.
   - [x] Blackhole TCP proxy integration: recovery in approximately **14 
seconds**, within the **40-second** bound, with a new connection established.
   - [x] Deterministic regression that fails before the EOF-admission fix and 
passes afterward; isolated cancellation reproduction now exits normally instead 
of terminating the process.
   - [ ] Confirm Linux/macOS/Windows GitHub Actions results; cross-platform CI 
is pending.


-- 
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]

Reply via email to