diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-11-28 11:47:24 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-28 11:47:24 -0800 |
| commit | 03ce060e854798437674b539d34afb8caaaf77fb (patch) | |
| tree | 464751f3f4f2e19b9eacd5276efbd6834edb4c10 /other/java | |
| parent | 626954b76c33b5d3f62a84a44537324d569fa9dd (diff) | |
| download | seaweedfs-03ce060e854798437674b539d34afb8caaaf77fb.tar.xz seaweedfs-03ce060e854798437674b539d34afb8caaaf77fb.zip | |
fix too many pings (#7566)
* fix too many pings
* constants
* Update weed/pb/grpc_client_server.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Diffstat (limited to 'other/java')
| -rw-r--r-- | other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java b/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java index 320a754ea..f8334b734 100644 --- a/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java +++ b/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java @@ -22,6 +22,10 @@ public class FilerGrpcClient { private static final SslContext sslContext; private static final String protocol; + // gRPC keepalive settings - must be consistent with server-side settings in grpc_client_server.go + private static final long KEEP_ALIVE_TIME_SECONDS = 60L; + private static final long KEEP_ALIVE_TIMEOUT_SECONDS = 20L; + static { sslContext = FilerSecurityContext.getGrpcSslContext(); protocol = FilerSecurityContext.isHttpSecurityEnabled() ? "https" : "http"; @@ -81,8 +85,8 @@ public class FilerGrpcClient { .flowControlWindow(16 * 1024 * 1024) .initialFlowControlWindow(16 * 1024 * 1024) .maxHeaderListSize(16 * 1024 * 1024) - .keepAliveTime(30, TimeUnit.SECONDS) - .keepAliveTimeout(10, TimeUnit.SECONDS) + .keepAliveTime(KEEP_ALIVE_TIME_SECONDS, TimeUnit.SECONDS) + .keepAliveTimeout(KEEP_ALIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS) .keepAliveWithoutCalls(true) .withOption(io.grpc.netty.shaded.io.netty.channel.ChannelOption.SO_RCVBUF, 16 * 1024 * 1024) .withOption(io.grpc.netty.shaded.io.netty.channel.ChannelOption.SO_SNDBUF, 16 * 1024 * 1024); |
