Skip to content

Handle race condition when inserting execution related entity count property (#4029) - #4341

Open
ESTeR9 wants to merge 1 commit into
flowable:mainfrom
ESTeR9:fix/4029-race-condition-validate-execution-entity-count
Open

ESTeR9 wants to merge 1 commit into
flowable:mainfrom
ESTeR9:fix/4029-race-condition-validate-execution-entity-count

Conversation

@ESTeR9

@ESTeR9 ESTeR9 commented Nov 27, 2026

Copy link
Copy Markdown

Fixes #4029

When multiple Flowable engine nodes start simultaneously in a distributed scenario, they can race to insert the cfg.execution-related-entities-count property into ACT_GE_PROPERTY. Both nodes see the property does not exist, both attempt to insert, and the second insert fails with a unique constraint violation, preventing engine startup.

This change wraps the initial insert in a try-catch block. When the insert fails (most likely due to a concurrent insert by another node), the code re-reads the property to determine whether another node already inserted it. If the property exists after the re-read, the code verifies consistency between the config value and the stored value, updating if needed. If the property still does not exist, a meaningful FlowableException is thrown.

Check List:

  • Unit tests: NO (race condition requires simultaneous multi-node startup — not reproducible in unit test)
  • Documentation: NA

…roperty (flowable#4029)

When multiple Flowable engine nodes start simultaneously in a distributed
scenario, they can race to insert the cfg.execution-related-entities-count
property into ACT_GE_PROPERTY. Both nodes see the property does not exist,
both attempt to insert, and the second insert fails with a unique constraint
violation.

This change wraps the initial insert in a try-catch block. When the insert
fails (most likely due to a concurrent insert by another node), the code
re-reads the property to determine whether another node already inserted it.
If the property exists after the re-read, the code verifies consistency
between the config value and the stored value, updating if needed. If the
property still does not exist, a meaningful FlowableException is thrown.

This branch has not been deployed

No deployments
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.

Flowable fails to be started in distributed scenario.

1 participant