8000 [JBPM-10249] Forcing dispose for command if transaction is not ready by fjtirado · Pull Request #2455 · kiegroup/jbpm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[JBPM-10249] Forcing dispose for command if transaction is not ready #2455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fjtirado
Copy link
Contributor
@fjtirado fjtirado commented Apr 11, 2025

Thank you for submitting this pull request

JIRA:

link

referenced Pull Requests:
kiegroup/droolsjbpm-knowledge#651

@@ -385,7 +389,7 @@ protected boolean canDispose(RuntimeEngine runtime) {
try {
// check tx status to disallow dispose when within active transaction
TransactionManager tm = getTransactionManagerInternal(getEnvironment(runtime));
if (tm.getStatus() != TransactionManager.STATUS_NO_TRANSACTION
if (!force && tm.getStatus() != TransactionManager.STATUS_NO_TRANSACTION
Copy link
Contributor Author
@fjtirado fjtirado Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole purpose of the PR is to prevent this status check to avoid disposing on RuntimeManager created for a Disposable command if the status of the transaction is unknown/active.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fjtirado it is not clear what this PR is trying to resolve. Can you provide more information about the root cause? What happened that caused the timer service not to release the lock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martinweiler This change is intended to ignore the transaction status when a dispose request is performed from a timer. Normally, the dispose request is ignored if the transaction status is not the desired one, but in the case of a timer I feel the transaction status is not relevant (because the timer is terminated for all practical purposes). So when a timer is done, I think the dispose should go through regardless of the transaction status (or we have the risk of the thread holding the lock forever, as it was apparently happening in the setup of the user reporting the issue)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some logging details to the jira https://issues.redhat.com/browse/RHPAM-5024 for your reference.

The root cause is not clear but is related to a transaction timeout. It looks to me when a transaction timeout occurs sometimes the transaction manager may not retrieve the right status.

@fjtirado
Copy link
Contributor Author

jenkins retest this

Copy link
Member
@gmunozfe gmunozfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, awesome, thanks @fjtirado !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0