diff --git a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java index f8a66626..46d64999 100644 --- a/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java +++ b/google-cloud-shell/src/main/java/com/google/cloud/shell/v1/stub/GrpcCloudShellServiceStub.java @@ -335,7 +335,13 @@ public UnaryCallable removePublicKeyCallable( @Override public final void close() { - shutdown(); + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } } @Override