Conversation
The CreateInstance example opened a Spanner instance without closing it. That was spamming the test logs with a lot of warnings.
Codecov Report
@@ Coverage Diff @@
## master #1116 +/- ##
============================================
- Coverage 84.98% 84.97% -0.01%
+ Complexity 2727 2724 -3
============================================
Files 156 156
Lines 14416 14416
Branches 1381 1381
============================================
- Hits 12251 12250 -1
- Misses 1594 1597 +3
+ Partials 571 569 -2
Continue to review full report at Codecov.
|
@@ -65,6 +65,8 @@ static void createInstance(String projectId, String instanceId) { | |||
instanceInfo.getId(), e.getMessage()); | |||
} catch (InterruptedException e) { | |||
System.out.println("Error: Waiting for createInstance operation to finish was interrupted"); | |||
} finally { | |||
spanner.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume your not using try-with-resources syntax because users are likely to keep spanner open across methods. If so, LGTM, if not, consider using try (spanner = ...) { ... }
syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, a Spanner
instance should preferably be kept open during the entire lifetime of the application, so we don't want to 'encourage' quickly opening and closing a Spanner
instance.
🤖 I have created a release \*beep\* \*boop\* --- ### [6.4.1](https://www..com/googleapis/java-spanner/compare/v6.4.0...v6.4.1) (2021-05-13) ### Documentation * close Spanner instance when it is no longer needed ([#1116](https://www..com/googleapis/java-spanner/issues/1116)) ([85bd0cf](https://www..com/googleapis/java-spanner/commit/85bd0cf11eab7b2ec47a082a4c2c0c4d9cea01d4)) ### Dependencies * update dependency com.google.cloud:google-cloud-monitoring to v2.2.2 ([#1158](https://www..com/googleapis/java-spanner/issues/1158)) ([63eed2e](https://www..com/googleapis/java-spanner/commit/63eed2e66fb063358e8b123ba5f919663b70bbe4)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#1152](https://www..com/googleapis/java-spanner/issues/1152)) ([2e7f18a](https://www..com/googleapis/java-spanner/commit/2e7f18a52ef2ed5de6a87169eeefd570844a4c55)) * update dependency org.openjdk.jmh:jmh-core to v1.30 ([#1137](https://www..com/googleapis/java-spanner/issues/1137)) ([699a426](https://www..com/googleapis/java-spanner/commit/699a4260e3b1a4cf53fc690910aeeadac293e469)) * update dependency org.openjdk.jmh:jmh-core to v1.31 ([#1160](https://www..com/googleapis/java-spanner/issues/1160)) ([43a0fb9](https://www..com/googleapis/java-spanner/commit/43a0fb97352d928e16ec5138ed2ea494ebaae343)) * update dependency org.openjdk.jmh:jmh-generator-annprocess to v1.30 ([#1138](https://www..com/googleapis/java-spanner/issues/1138)) ([ad6649d](https://www..com/googleapis/java-spanner/commit/ad6649df03a1a193dd524a84fe9dc1a72ed14e09)) * update dependency org.openjdk.jmh:jmh-generator-annprocess to v1.31 ([#1161](https://www..com/googleapis/java-spanner/issues/1161)) ([4d17da2](https://www..com/googleapis/java-spanner/commit/4d17da25977dde0cc1032192045d9ee26d3fae09)) --- This PR was generated with [Release Please](https://.com/googleapis/release-please). See [documentation](https://.com/googleapis/release-please#release-please).
The CreateInstance example opened a Spanner instance without closing it. That was spamming the test logs with a lot of the following warnings:
(See for example https://source.cloud.google.com/results/invocations/983ec088-8806-4576-8f9c-640be588a836/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fjava-spanner%2Fnightly%2Fjava8-samples/log)