Commit b19a3f4
committed
server: enhance gRPC keepalive configuration
In this commit, we enhance the server-side gRPC keepalive configuration
to work in coordination with the client-side keepalive settings added
in the previous commit. This completes the fix for issue #1814 by
ensuring both sides of the connection actively maintain connection
health.
Previously, the server only configured MaxConnectionIdle set to 2
minutes, which would aggressively close idle connections. This caused
problems for price oracle connections that could be idle for extended
periods between RFQ operations. We now extend MaxConnectionIdle to 24
hours and add active health checking through Time and Timeout
parameters.
The critical addition is the EnforcementPolicy with PermitWithoutStream
set to true. This allows clients to send keepalive pings even when no
RPC calls are active, which is essential for long-lived connections.
Without this policy, the server would reject client keepalive pings on
idle connections, defeating the purpose of the client-side keepalive
configuration.
These settings follow the same pattern used by lnd and are based on
gRPC's official keepalive recommendations. The combination of active
pinging from both client and server, along with permissive policies,
ensures connections remain healthy and any network issues are detected
promptly rather than discovered only when the next RPC fails.
Fixes #18141 parent a9748a9 commit b19a3f4
1 file changed
+28
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
378 | 401 | | |
379 | 402 | | |
380 | 403 | | |
| |||
0 commit comments