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
chore: consolidate cancel trampolines at VOperationImpl
VOperationImpl captures opExecutor in start() and trampolines start/cancel
via it. RetryingVRpc.start runs synchronously on the op-executor task
RetryingVRpc.cancel no longer wraps in execute. Tracer.onOperationStart
reordered before started=true (a throwing tracer short-circuits to direct
listener.onClose). listener.onMessage failures classify as USER_FAILURE.
CleanupListener tracks a closed flag to prevent gRPC-context listener
leaks on synchronous chain close.
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java
+83-54Lines changed: 83 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,11 @@ public class RetryingVRpc<ReqT, RespT> implements VRpc<ReqT, RespT> {
47
47
48
48
privatefinalBigtableTimertimer;
49
49
50
-
// current state and all the flags don't need to be volatile because they're only updated within
51
-
// the op executor.
50
+
// All mutable state is owned by the op executor; VOperationImpl trampolines every inbound call
51
+
// onto it, so no synchronization is needed here.
52
52
privateStatecurrentState;
53
53
privatebooleanstarted;
54
-
// Breaks the loop if uncaught exception happens during op-executor execution.
54
+
// Breaks the loop on uncaught exception during cancel.
Copy file name to clipboardExpand all lines: java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VOperationImpl.java
+29-9Lines changed: 29 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,9 @@
30
30
importjavax.annotation.Nullable;
31
31
32
32
/**
33
-
* The single edge between the user and the VRpc middleware chain. Constructs the per-op {@link
34
-
* VRpcCallContext} and owns the gRPC {@link Context} cancellation listener.
33
+
* The single edge between the user and the VRpc middleware chain. Trampolines all inbound user
34
+
* calls onto opExecutor and owns the gRPC {@link Context} cancellation listener so that every
35
+
* layer below is single-threaded on opExecutor.
35
36
*
36
37
* <p>Precondition: {@link #cancel} must not be called before {@link #start}.
37
38
*/
@@ -45,6 +46,10 @@ public class VOperationImpl<ReqT, RespT> implements VOperation<ReqT, RespT> {
0 commit comments