Skip to content
Permalink
Browse files
docs: close Spanner instance when it is no longer needed (#1116)
The CreateInstance example opened a Spanner instance without closing it.
That was spamming the test logs with a lot of warnings.
  • Loading branch information
olavloite committed May 3, 2021
1 parent 47f5965 commit 85bd0cf11eab7b2ec47a082a4c2c0c4d9cea01d4
Showing with 2 additions and 0 deletions.
  1. +2 −0 samples/snippets/src/main/java/com/example/spanner/CreateInstanceExample.java
@@ -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();
}
}
}

0 comments on commit 85bd0cf

Please sign in to comment.