Skip to content

Commit 5b11c6e

Browse files
javabrownsduskis
authored andcommitted
---
yaml --- r: 13971 b: refs/heads/autosynth-container c: e9ea3d9 h: refs/heads/master i: 13969: 70017c0 13967: ac4d1bc
1 parent cc015a1 commit 5b11c6e

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

  • branches/autosynth-container/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ refs/tags/v0.65.0: 10939381ffe0b8da32db4fe3087c86e3aa7f3e55
113113
refs/tags/v0.66.0: ed6a3f57cbdaa20339a1995f7d7d53b172a5b8ef
114114
refs/tags/v0.67.0: 30b56f02092efc6f3c3667650ea8b8825003e0b7
115115
refs/heads/autosynth-compute: 8e86445e504cea6f99b9fb237bfd7f0e5ef8b3ce
116-
refs/heads/autosynth-container: 36fbd97799e222fac888ca5e643beb37d6700c77
116+
refs/heads/autosynth-container: e9ea3d9bacf0410ef578a9d5c2d25fcbe5955a0d
117117
refs/heads/autosynth-dataproc: bc74a8841bc1693d7945d991d15979df550b1fd1
118118
refs/heads/autosynth-monitoring: 120f508e0065f4ce39cf0e6a69a08138773f2cfb
119119
refs/heads/autosynth-pubsub: ed3340e32d13bb1a42ca4431cb1ad9bdaf550aa4

branches/autosynth-container/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
import java.util.concurrent.ExecutionException;
108108
import java.util.concurrent.Executors;
109109
import java.util.concurrent.Future;
110+
import java.util.concurrent.ScheduledExecutorService;
110111
import javax.annotation.Nullable;
111112
import org.threeten.bp.Duration;
112113

@@ -139,6 +140,8 @@ public class GapicSpannerRpc implements SpannerRpc {
139140
private final Duration checkInterval =
140141
systemProperty(PROPERTY_PERIOD_SECONDS, DEFAULT_PERIOD_SECONDS);
141142

143+
private final ScheduledExecutorService spannerWatchdog;
144+
142145
public static GapicSpannerRpc create(SpannerOptions options) {
143146
return new GapicSpannerRpc(options);
144147
}
@@ -191,14 +194,15 @@ public GapicSpannerRpc(SpannerOptions options) {
191194
CredentialsProvider credentialsProvider =
192195
GrpcTransportOptions.setUpCredentialsProvider(options);
193196

197+
spannerWatchdog =
198+
Executors.newSingleThreadScheduledExecutor(
199+
new ThreadFactoryBuilder()
200+
.setDaemon(true)
201+
.setNameFormat("Cloud-Spanner-WatchdogProvider-%d")
202+
.build());
194203
WatchdogProvider watchdogProvider =
195204
InstantiatingWatchdogProvider.create()
196-
.withExecutor(
197-
Executors.newSingleThreadScheduledExecutor(
198-
new ThreadFactoryBuilder()
199-
.setDaemon(true)
200-
.setNameFormat("Cloud-Spanner-WatchdogProvider-%d")
201-
.build()))
205+
.withExecutor(spannerWatchdog)
202206
.withCheckInterval(checkInterval)
203207
.withClock(NanoClock.getDefaultClock());
204208

@@ -572,6 +576,7 @@ public void shutdown() {
572576
this.spannerStub.close();
573577
this.instanceAdminStub.close();
574578
this.databaseAdminStub.close();
579+
this.spannerWatchdog.shutdown();
575580
}
576581

577582
/**

0 commit comments

Comments
 (0)