dcapwell commented on code in PR #101:
URL: https://github.com/apache/cassandra-accord/pull/101#discussion_r1664567680


##########
accord-core/src/main/java/accord/coordinate/CoordinatePreAccept.java:
##########
@@ -152,7 +152,12 @@ void onNewEpochTopologyMismatch(TopologyMismatch mismatch)
     void onPreAccepted(Topologies topologies)
     {
         Timestamp executeAt = foldl(oks, (ok, prev) -> 
mergeMax(ok.witnessedAt, prev), Timestamp.NONE);
-        node.withEpoch(executeAt.epoch(), () -> onPreAccepted(topologies, 
executeAt, oks));
+        node.withEpoch(executeAt.epoch(), (ignored, withEpochFailure) -> {

Review Comment:
   Gave this example on slack...
   
   `accord-core/src/main/java/accord/coordinate/Recover.java`
   
   ```
   node.withEpoch(invalidateUntil.epoch(), (ignored, withEpochFailure) -> {
               // TODO (review): There was already nothing here to handle 
failures in commitInvalidate
               if (withEpochFailure != null)
               {
                   
node.agent().onUncaughtException(CoordinationFailed.wrap(withEpochFailure));
                   return;
               }
               Commit.Invalidate.commitInvalidate(node, txnId, route, 
invalidateUntil);
           });
   ```
   
   vs
   
   ```
   node.withEpoch(invalidateUntil.epoch())
       .accept(ignore -> Commit.Invalidate.commitInvalidate(node, txnId, route, 
invalidateUntil))
       .begin(agent);
   ```
   
   For this project, when given the success and failure we keep ignoring the 
errors, and this patch is kinda trying to address that by handling the 
errors... but we keep having this problem over and over again; callbacks have 
been very error prone for us...
   
   By using `AsyncChain` we can focus on the success cases only and can send 
the unexpected / unhandled errors to the `agent`



-- 
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