Closed dpasek-senacor closed 1 year ago
Thanks for bringing this to our attention. The behaviour in the ConnectionSettingsBuilder
is incorrect, it should log a warning about the value being changed, but should still allow you to set it to a lower value.
This is handled correctly when using the Connection String.
The
ConnectionSettingsBuilder
performs validation on thekeepAliveInterval
andkeepAliveTimeout
values.If the value is below the configured defaults the given values or ignored and the internal defaults defined in
Consts
:The default value for the
keepAliveInterval
of 10s makes sense and is in line with the internal defaults used by the gRPC library. The value forkeepAliveTimeout
on the other hand is very long (waiting for a minimum 10s for the PING response) and not in line with the values proposed by the gRPC library. In the gRPC library the defaults forkeepAliveInterval
undkeepAliveTimeout
are managed inside theKeepAliveManager
class: https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/internal/KeepAliveManager.javaAs you can see the minimum value for the
keepAliveTimeout
is defined as 10 _milli_seconds which seems muhc more pratical for detecting connection outages as the server response to PING should be matters of milliseconds, not seconds.To better detect connection issues during idle times the minimum
keepAliveTimeout
value should be adapted to the default of the gRPC library.