Skip to content

Commit 67bd06a

Browse files
fix: block close() on the termination of all RPC channels (#512)
1 parent 6841cd5 commit 67bd06a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google-cloud-firestore/src/main/java/com/google/cloud/firestore/spi/v1/GrpcFirestoreRpc.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import java.io.IOException;
6767
import java.util.Collections;
6868
import java.util.concurrent.ScheduledExecutorService;
69+
import java.util.concurrent.TimeUnit;
6970

7071
/**
7172
* GRPC client implementation of the Firestore RPC methods. Exposes FirestoreOptions on top of the
@@ -152,6 +153,9 @@ public void close() throws Exception {
152153
for (BackgroundResource resource : clientContext.getBackgroundResources()) {
153154
resource.close();
154155
}
156+
for (BackgroundResource resource : clientContext.getBackgroundResources()) {
157+
resource.awaitTermination(1, TimeUnit.SECONDS);
158+
}
155159
executorFactory.release(executor);
156160
}
157161

0 commit comments

Comments
 (0)