perf: remove custom transport executor#2366
Conversation
Remove the custom executor provider that is set on the underlying generated clients and instead use the internal core gRPC executor provider. The latter is a shared executor provider for all gRPC channels that creates threads on demand. This prevents the creation of unnecessary threads at startup, and can reduce overall thread usage for applications that create multiple Spanner instances during their lifetime.
| @Override | ||
| public void release(ScheduledExecutorService executor) { | ||
| executor.shutdown(); | ||
| try { |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
| SpannerOptions.newBuilder().setProjectId("test-project").enableGrpcGcpExtension().build(); | ||
| SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setCredentials(NoCredentials.getInstance()) |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
| SpannerOptions options = | ||
| SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setCredentials(NoCredentials.getInstance()) |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
| SpannerOptions options1 = | ||
| SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setCredentials(NoCredentials.getInstance()) |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
| SpannerOptions options2 = | ||
| SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setCredentials(NoCredentials.getInstance()) |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
|
|
||
| assertNotSame(spanner1, spanner2); | ||
|
|
||
| spanner1.close(); |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
| SpannerOptions.newBuilder().setProjectId("test-project").enableGrpcGcpExtension().build(); | ||
| SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setCredentials(NoCredentials.getInstance()) |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
|
|
||
| assertNotSame(spanner1, spanner2); | ||
|
|
||
| spanner1.close(); |
There was a problem hiding this comment.
This cleans up errors that are being logged during tests, clogging up the test log.
🤖 I have created a release *beep* *boop* --- ## [6.40.0](https://togithub.com/googleapis/java-spanner/compare/v6.39.0...v6.40.0) (2023-04-14) ### Features * Savepoints ([#2278](https://togithub.com/googleapis/java-spanner/issues/2278)) ([b02f584](https://togithub.com/googleapis/java-spanner/commit/b02f58435b97346cc8e08a96635affe8383981bb)) ### Performance Improvements * Remove custom transport executor ([#2366](https://togithub.com/googleapis/java-spanner/issues/2366)) ([e27dbe5](https://togithub.com/googleapis/java-spanner/commit/e27dbe5f58229dab208eeeed44d53e741700c814)) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.7.0 ([#2377](https://togithub.com/googleapis/java-spanner/issues/2377)) ([40402af](https://togithub.com/googleapis/java-spanner/commit/40402af54f94f16619d018e252181db29ae6855e)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 ([#2379](https://togithub.com/googleapis/java-spanner/issues/2379)) ([ae7262d](https://togithub.com/googleapis/java-spanner/commit/ae7262d37391c0ec2fee1dcbb24899e4fa16ae17)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 ([#2380](https://togithub.com/googleapis/java-spanner/issues/2380)) ([0cb159e](https://togithub.com/googleapis/java-spanner/commit/0cb159efc97f02b42f064244e3812a0fd3d82db6)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Remove the custom executor provider that is set on the underlying generated clients and instead use the internal core gRPC executor provider. The latter is a shared executor provider for all gRPC channels that creates threads on demand. This prevents the creation of unnecessary threads at startup, and can reduce overall thread usage for applications that create multiple Spanner instances during their lifetime.