rpuch commented on code in PR #5209:
URL: https://github.com/apache/ignite-3/pull/5209#discussion_r1982778897


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/ReadOnlyTransactionImpl.java:
##########
@@ -113,22 +113,31 @@ public TablePartitionId commitPartition() {
     @Override
     public CompletableFuture<Void> commitAsync() {
         return TransactionsExceptionMapperUtil.convertToPublicFuture(
-                finish(true, readTimestamp, false),
+                finish(true, readTimestamp, false, false),
                 TX_COMMIT_ERR
         );
     }
 
     @Override
     public CompletableFuture<Void> rollbackAsync() {
         return TransactionsExceptionMapperUtil.convertToPublicFuture(
-                finish(false, readTimestamp, false),
+                finish(false, readTimestamp, false, false),
                 TX_ROLLBACK_ERR
         );
     }
 
     @Override
-    public CompletableFuture<Void> finish(boolean commit, HybridTimestamp 
executionTimestamp, boolean full) {
+    public CompletableFuture<Void> rollbackTimeoutExceededAsync() {
+        return TransactionsExceptionMapperUtil.convertToPublicFuture(
+                finish(false, readTimestamp, false, true),
+                TX_ROLLBACK_ERR
+        ).thenAccept(unused -> this.timeoutExceeded = true);

Review Comment:
   Well, I think first it should be decided whether 'before' and 'after' are 
equivalent :) What triggered me here is that it seems that 'actually finishing 
and marking as `timeoutExceeded`' do not look atomic. What happens if someone 
sees that the transaction is already finished, but does not see the effect of 
the flag assignment yet? Are other races possible?



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to