vldpyatkov commented on code in PR #5146:
URL: https://github.com/apache/ignite-3/pull/5146#discussion_r1940871344
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/ReadWriteTransactionImpl.java:
##########
@@ -159,18 +162,54 @@ public CompletableFuture<Void> finish(boolean commit,
@Nullable HybridTimestamp
return finishFuture;
}
+ return finishInternal(commit, executionTimestamp, full, true);
+ }
+
+ private CompletableFuture<Void> finishInternal(
+ boolean commit,
+ @Nullable HybridTimestamp executionTimestamp,
+ boolean full,
+ boolean isComplete
+ ) {
enlistPartitionLock.writeLock().lock();
try {
if (finishFuture == null) {
+ if (killed) {
+ if (isComplete) {
+ finishFuture = nullCompletedFuture();
+
+ return failedFuture(new TransactionException(
+ TX_ALREADY_FINISHED_ERR,
+ format("Transaction is killed [id={},
state={}].", id(), state())
+ ));
+ } else {
+ return nullCompletedFuture();
+ }
+ }
+
if (full) {
txManager.finishFull(observableTsTracker, id(),
executionTimestamp, commit);
- finishFuture = nullCompletedFuture();
+ if (isComplete) {
+ finishFuture = nullCompletedFuture();
+ } else {
+ killed = true;
Review Comment:
Created ticket 'IGNITE-24382 Kill implicit read-write transaction.'
--
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]