Skip to content

Commit e3775f1

Browse files
authored
Merge pull request #44131 from gimantha/9.x-fix44117
Fix panic at connection close
2 parents a4405c3 + b1bccd4 commit e3775f1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/transactions/TransactionResourceManager.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,13 @@ public boolean notifyCommit(String transactionId, String transactionBlockId) {
372372
log.error("error when committing transaction " + transactionId + ":" + e.getMessage(), e);
373373
commitSuccess = false;
374374
} finally {
375-
ctx.close();
375+
try {
376+
ctx.close();
377+
} catch (Exception e) {
378+
log.error("error when committing and releasing resources for transaction " + transactionId +
379+
":" + e.getMessage(), e);
380+
commitSuccess = false;
381+
}
376382
}
377383
}
378384
}
@@ -429,7 +435,13 @@ public boolean notifyAbort(String transactionId, String transactionBlockId) {
429435
log.error("error when aborting the transaction " + transactionId + ":" + e.getMessage(), e);
430436
abortSuccess = false;
431437
} finally {
432-
ctx.close();
438+
try {
439+
ctx.close();
440+
} catch (Exception e) {
441+
log.error("error when aborting and releasing resources for transaction " + transactionId +
442+
":" + e.getMessage(), e);
443+
abortSuccess = false;
444+
}
433445
}
434446
}
435447
}

0 commit comments

Comments
 (0)