You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Step 10 — route PendingVRpc per-op state through op executor
isCancelled and realCall are now exclusively owned by ctx.getExecutor()
(the per-op SerializingExecutor), eliminating the cancel/drainTo race
that required the NOOP_CALL sentinel. cancel() eagerly removes from
pendingRpcs under the pool lock, then dispatches the state transition to
the op executor. drainTo() cancels the deadline monitor before dispatching,
and checks isCancelled on the op executor so a cancelled-before-drain rpc
returns its session cleanly via onVRpcComplete(). popClosableRpcs() and
tryDrainPendingRpcs() are simplified now that cancelled rpcs are removed
eagerly. close() copies pendingRpcs before clearing to avoid
ConcurrentModificationException when cancel() re-acquires the pool lock.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java
+40-54Lines changed: 40 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -245,6 +245,7 @@ public SessionPoolInfo getInfo() {
245
245
publicvoidclose(CloseSessionRequestreq) {
246
246
configListenerHandle.close();
247
247
248
+
List<PendingVRpc<?, ?>> toCancel;
248
249
synchronized (this) {
249
250
if (poolState == PoolState.CLOSED) {
250
251
logger.fine(String.format("Tried to close a closed SessionPool %s", info.getLogName()));
@@ -254,9 +255,8 @@ public void close(CloseSessionRequest req) {
254
255
255
256
poolState = PoolState.CLOSED;
256
257
257
-
for (PendingVRpc<?, ?> pendingRpc : pendingRpcs) {
0 commit comments