Skip to content

Commit 299593f

Browse files
committed
fix(bigtable): avoid double close on pending vrpcs
1 parent ca594e4 commit 299593f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session

java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ public void start(ReqT req, VRpcCallContext ctx, VRpcListener<RespT> listener) {
634634
this.deadlineMonitor = monitorDeadline(executorService, ctx.getOperationInfo().getDeadline());
635635

636636
synchronized (SessionPoolImpl.this) {
637+
if (isCancelled) {
638+
// If the vRPC is already cancelled from a different thread return
639+
// early to avoid double close
640+
return;
641+
}
637642
if (SessionPoolImpl.this.poolState != PoolState.STARTED) {
638643
listener.onClose(
639644
VRpcResult.createUncommitedError(

0 commit comments

Comments
 (0)