Skip to content

Commit ff5374f

Browse files
javabrownsduskis
authored andcommitted
---
yaml --- r: 13511 b: refs/heads/autosynth-dlp c: e9ea3d9 h: refs/heads/master i: 13509: a54e849 13507: 3771b0e 13503: abc6b9d
1 parent 9aec740 commit ff5374f

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

  • branches/autosynth-dlp/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
@@ -104,7 +104,7 @@ refs/tags/v0.60.0: 4cd518d0612329f8a8e53484eef4cd1651e32855
104104
refs/tags/v0.61.0: e4b526656bb1bf5eefd0ee578b7405147821225e
105105
refs/tags/v0.62.0: bbede7385d48ba08f487bdd29ec10668ace96396
106106
refs/heads/0.60.0-alpha: 10939381ffe0b8da32db4fe3087c86e3aa7f3e55
107-
refs/heads/autosynth-dlp: 36fbd97799e222fac888ca5e643beb37d6700c77
107+
refs/heads/autosynth-dlp: e9ea3d9bacf0410ef578a9d5c2d25fcbe5955a0d
108108
refs/heads/autosynth-logging: f8794c50a64f62b167cddf42513d133547679e01
109109
refs/heads/dupes: 3478c5d81fd242d0e985656645a679420a2060c2
110110
refs/tags/v0.63.0: 94f19b71d40f46b36120e7b9d78a1a3d41bfcbd6

branches/autosynth-dlp/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)