tmgodinho commented on code in PR #7844:
URL: https://github.com/apache/ignite-3/pull/7844#discussion_r3118647854


##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientLazyTransaction.java:
##########
@@ -94,12 +105,35 @@ public void rollback() throws TransactionException {
     public CompletableFuture<Void> rollbackAsync() {
         var tx0 = tx;
 
+        // TODO: IGNITE-28405 This is really fishy. It will probably let you 
reuse a transaction after calling a rollback :(
         if (tx0 == null) {
             // No operations were performed, nothing to rollback.
             return nullCompletedFuture();
         }
 
-        return tx0.thenCompose(ClientTransaction::rollbackAsync);
+        // If the transaction is not started. Issue the rollback and wait for 
the server response.
+        if (!tx0.isDone() && cancelled.compareAndSet(false, true)) {
+            return requestInfoFuture

Review Comment:
   Sorry @ptupitsyn, I did not understand your question before, and I've 
written the message above in the wrong comment.
   
   The correct answer here would be if there is an error on the client side, 
the Transaction future, tx0 should be invalidated. Ideally, it should be done 
before the rollback call is done, so it does not enter in the if statement. But 
I'll harden this check, I'm not sure it's reliable. I don't remember if I 
checked it or not before.



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

Reply via email to