File tree
Expand file treeCollapse file tree1 file changed
+5
-0
lines changed google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1
Expand file treeCollapse file tree1 file changed
+5
-0
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -168,6 +168,7 @@ private synchronized void shutdown() {
|
168 | 168 | "com.google.cloud.spanner.watchdogPeriodSeconds";
|
169 | 169 | private static final int DEFAULT_TIMEOUT_SECONDS = 30 * 60;
|
170 | 170 | private static final int DEFAULT_PERIOD_SECONDS = 10;
|
| 171 | +private static final int GRPC_KEEPALIVE_SECONDS = 2 * 60; |
171 | 172 |
|
172 | 173 | private final ManagedInstantiatingExecutorProvider executorProvider;
|
173 | 174 | private boolean rpcIsClosed;
|
@@ -242,6 +243,10 @@ public GapicSpannerRpc(final SpannerOptions options) {
|
242 | 243 | .setPoolSize(options.getNumChannels())
|
243 | 244 | .setExecutorProvider(executorProvider)
|
244 | 245 |
|
| 246 | +// Set a keepalive time of 120 seconds to help long running |
| 247 | +// commit GRPC calls succeed |
| 248 | +.setKeepAliveTime(Duration.ofSeconds(GRPC_KEEPALIVE_SECONDS)) |
| 249 | + |
245 | 250 | // Then check if SpannerOptions provides an InterceptorProvider. Create a default
|
246 | 251 | // SpannerInterceptorProvider if none is provided
|
247 | 252 | .setInterceptorProvider(
|
|
You can’t perform that action at this time.
0 commit comments