-
Notifications
You must be signed in to change notification settings - Fork 4
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
Control the id generation for BpmProcessInstance #1115
Comments
The issue is partially fixed. But there is still a problem in:
If two different Gems (transactions) at the same time are adding a process it could be possible that both transactions generate the same id (let's call it clashID) and for both transactions This is a border case because both process must have identical process definition and both transaction must overlap during the commit. In practical terms is highly unlikely but theorically possible. It will depend on how many process are been created per millisecond. |
It seems if |
When a new
BpmProcessInstance
is created control if the id already exist.The probability of an id clash is pretty high with 100.000 instances with ids up to 4294967295 (32 bit number).
Note:
theorically it could be a clash of [id] in collection IF for the same [BpmProcessDefinition] the random generation answer the same number [id := Lag1MwcRandom new integer].
Lag1MwcRandom new integer - answer a nonnegative 32bit integer. (max 4.294.967.295)
The probability of a clash depends on the number of [BpmProcessInstances]:
It can be calculated with (it take to much time to calculate):
A more efficient way is:
With 100000 is pretty possible to have a clash --> a new issue to control the clash of ids should be created.
The text was updated successfully, but these errors were encountered: