Skip to content

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

Open
fjtirado wants to merge 1 commit into
kiegroup:mainfrom
fjtirado:JBPM-10249
Open

[JBPM-10249] Forcing dispose for command if transaction is not ready#2455
fjtirado wants to merge 1 commit into
kiegroup:mainfrom
fjtirado:JBPM-10249

Conversation

@fjtirado
Copy link
Copy Markdown
Contributor

@fjtirado fjtirado commented Apr 11, 2025

Thank you for submitting this pull request

JIRA:

link

referenced Pull Requests:
kiegroup/droolsjbpm-knowledge#651

// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

jenkins retest this

Copy link
Copy Markdown
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