tmgodinho commented on code in PR #7844:
URL: https://github.com/apache/ignite-3/pull/7844#discussion_r3010258779
##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientLazyTransaction.java:
##########
@@ -94,12 +100,30 @@ public void rollback() throws TransactionException {
public CompletableFuture<Void> rollbackAsync() {
var tx0 = tx;
+ // 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
+ .thenCompose(reqInfo ->
+ reqInfo.ch.serviceAsync(ClientOp.TX_ROLLBACK, w ->
w.out().packLong(-reqInfo.firstReqId), r -> null)
Review Comment:
Essentially, it will experience the old "blocking" behaviour.
The request will be sent to the server, the server will panic at:
https://github.com/apache/ignite-3/pull/7844/changes/BASE..f649f764f18e572f830208127faddbc566fc8a6f#diff-6e5ede08174517c940134dafdcb9270727ed3738dcb475582b48c017344896f2L59
The client will pick the error, and try to rollback using the old method
once the tx information is known.
I assumed it was ok just to fix it for newer versions without breaking the
previous ones.
PS: The error is something like, resource not found, nothing very relevant.
--
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]