|
26 | 26 | YDB_REQUEST_TYPE_HEADER = "x-ydb-request-type"
|
27 | 27 |
|
28 | 28 | _DEFAULT_MAX_GRPC_MESSAGE_SIZE = 64 * 10**6
|
| 29 | +_DEFAULT_KEEPALIVE_TIMEOUT = 10000 |
29 | 30 |
|
30 | 31 |
|
31 | 32 | def _message_to_string(message):
|
@@ -185,15 +186,18 @@ def _construct_channel_options(driver_config, endpoint_options=None):
|
185 | 186 | getattr(driver_config, "grpc_lb_policy_name", "round_robin"),
|
186 | 187 | ),
|
187 | 188 | ]
|
188 |
| - if driver_config.grpc_keep_alive_timeout is not None: |
189 |
| - _default_connect_options.extend( |
190 |
| - [ |
191 |
| - ("grpc.keepalive_time_ms", driver_config.grpc_keep_alive_timeout >> 3), |
192 |
| - ("grpc.keepalive_timeout_ms", driver_config.grpc_keep_alive_timeout), |
193 |
| - ("grpc.http2.max_pings_without_data", 0), |
194 |
| - ("grpc.keepalive_permit_without_calls", 0), |
195 |
| - ] |
196 |
| - ) |
| 189 | + if driver_config.grpc_keep_alive_timeout is None: |
| 190 | + driver_config.grpc_keep_alive_timeout = _DEFAULT_KEEPALIVE_TIMEOUT |
| 191 | + |
| 192 | + _default_connect_options.extend( |
| 193 | + [ |
| 194 | + ("grpc.keepalive_time_ms", driver_config.grpc_keep_alive_timeout >> 3), |
| 195 | + ("grpc.keepalive_timeout_ms", driver_config.grpc_keep_alive_timeout), |
| 196 | + ("grpc.http2.max_pings_without_data", 0), |
| 197 | + ("grpc.keepalive_permit_without_calls", 0), |
| 198 | + ] |
| 199 | + ) |
| 200 | + |
197 | 201 | if endpoint_options is not None:
|
198 | 202 | if endpoint_options.ssl_target_name_override:
|
199 | 203 | _default_connect_options.append(
|
|
0 commit comments