belliottsmith commented on code in PR #113:
URL: https://github.com/apache/cassandra-accord/pull/113#discussion_r1746076475


##########
accord-core/src/main/java/accord/messages/ReadData.java:
##########
@@ -348,45 +380,42 @@ protected void onAllSuccess(@Nullable Ranges unavailable, 
@Nullable Data data, @
 
             case PENDING:
                 state = State.RETURNED;
-                node.reply(replyTo, replyContext, fail == null ? 
constructReadOk(unavailable, data) : null, fail);
+                node.reply(replyTo, replyContext, fail == null ? 
constructReadOk(unavailable, notReady, data) : null, fail);
                 break;
 
             default:
                 throw new AssertionError("Unknown state: " + state);
         }
     }
 
-    void beginCancel(@Nullable SafeCommandStore safeStore)
+    void cancel()
     {
-        if (safeStore != null)
-        {
-            int id = safeStore.commandStore().id();
-            cancelWaiting(safeStore);
-            waitingOn.clear(id);
-        }
+        if (timeout != null)
+            timeout.cancel();
 
-        // TODO (expected): efficient unsubscribe mechanism
-        node.commandStores().mapReduceConsume(this, waitingOn.stream(), 
forEach(safeStore0 -> cancelWaiting(safeStore0), node.agent()));
         state = State.OBSOLETE;
+        registrations.forEach((i, r) -> r.cancel());
         waitingOn.clear();
-        reading = null;
+        reading.clear();
         data = null;
         unavailable = null;
+        notReady = null;
     }
 
-    protected void beginWaiting(SafeCommandStore safeStore, boolean 
isExecuting)
+    synchronized public void timeout()

Review Comment:
   it's invoked by `DefaultRequestTimeouts`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to