-
Notifications
You must be signed in to change notification settings - Fork 623
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
Process instance no longer subscribed to message after unsuccessful process instance migration #25166
Comments
@berkaycanbc and I investigated this issue and have the following findings:
One solution could be to remove the pending subscription from this transient state when rejecting the instance migration (and reverting changes). However, that would mean that the checker would be able to encounter the pending subscription before it may still be reverted. Instead, it would be better to avoid adding the pending subscription to the transient state until the entire command has been processed successfully. We could try to achieve this using the stream processor's side effects, which are only applied after a command was successfully processed. |
@berkaycanbc and I have been making progress on this issue (branch: We've verified that this works with our reproducing test case, however this test is slow and not maintainable, so we will open a PR as soon as we have one that is. We also need to resolve the issue on subscribing to new messages as this could also produce wrong results (although less impactful). |
@korthout Since it's possible to recover from this (at least that's how I understood your "To recover" instructions), I'd argue that this doesn't qualify as critical. |
Good point @lenaschoenburg. I considered it critical because of the impact, but the workaround should be reasonable. Lowered to high. |
## Description <!-- Describe the goal and purpose of this PR. --> This PR will enable the transient state in `ProcessMessageSubscriptionState` to be updated as a side effect. ### Why do we need this change? This resolves a critical bug, where a process instance is unsubscribed from a message catch event during instance migration even though the migration was rejected by throwing an exception. When the exception is thrown, we expect all state changes to be rolled back. However, the transient state for pending process message subscriptions was not rolled back. This led to the `PendingSubscriptionChecker` to visit this pending subscription, even though the rest of the engine considered it to be rolled back. The transient state was updated by the `DbProcessMessageSubscriptionState.updateToClosingState()` which in turn is called by the `ProcessMessageSubscriptionDeletingApplier`. By moving the transient state update from the dbstate (applier) to a side-effect in the `CatchEventBehavior`, we're able to ensure that the state change only takes effect after the command was successfully processed (completely). ## Related issues closes #25166
# Description Backport of #25298 to `main`. relates to #25166 original author: @berkaycanbc
…age state as side-effect (#25495) # Description Backport of #25476 to `release-8.7.0-alpha2`. relates to #25298 #25166 original author: @backport-action
…as side-effect (#25497) # Description Backport of #25476 to `stable/8.5`. relates to #25298 #25166 original author: @backport-action
Describe the bug
We've discovered a critical bug that can delete the
ProcessMessageSubscription
andMessageSubscription
during Process Instance Migration, even though the migration is rejected. This should not have any affects and all changes are supposed to have been rolled back.https://jira.camunda.com/browse/SUPPORT-24591
To Reproduce
To recover: retry the process instance migration after waiting at least 30 seconds. This will automatically recreate the deleted message subscription as documented:
Expected behavior
When the migration is rejected, the process instance should not have been changed.
Log/Stacktrace
Full Stacktrace
Environment:
The text was updated successfully, but these errors were encountered: