RockteMQ-AI opened a new pull request, #10516:
URL: https://github.com/apache/rocketmq/pull/10516

   ## Motivation
   
   When a TCP connection is broken without a RST, the gRPC client needs to rely 
on HTTP/2 PING (keepalive) to detect the dead connection. Currently, the gRPC 
server in the Proxy does **not** configure `permitKeepAliveTime` or 
`permitKeepAliveWithoutCalls`, which means gRPC Netty server defaults apply:
   
   - `permitKeepAliveTime` = **5 minutes** — clients cannot send keepalive 
pings more frequently than every 5 minutes
   - `permitKeepAliveWithoutCalls` = **false** — keepalive pings on idle 
connections are rejected
   
   This causes slow dead-connection detection (up to 5.5 minutes) and 
ineffective idle connection health checks.
   
   Fixes #10510
   
   ## Changes
   
   Add two configurable parameters to `ProxyConfig`:
   
   | Parameter | Default | Description |
   |-----------|---------|-------------|
   | `grpcServerPermitKeepAliveTimeMillis` | 10000 (10s) | Minimum time between 
client keepalive pings |
   | `grpcServerPermitKeepAliveWithoutCalls` | true | Allow keepalive pings 
when no active RPCs |
   
   Apply these in `GrpcServerBuilder`:
   ```java
   serverBuilder
       .permitKeepAliveTime(config.getGrpcServerPermitKeepAliveTimeMillis(), 
TimeUnit.MILLISECONDS)
       
.permitKeepAliveWithoutCalls(config.isGrpcServerPermitKeepAliveWithoutCalls());
   ```
   
   ## Impact
   
   - **Backward compatible**: Default values are more permissive than current 
implicit defaults
   - **Minimal overhead**: ~8KB/hour per connection at 30s interval
   - **Enables faster detection**: Once clients reduce keepAliveTime, 
dead-connection detection can drop from 5.5 minutes to ~40 seconds


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