Skip to content
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

[Backport stable/8.0] Reject duplicate parallel gateway activate command #9823

Merged
merged 5 commits into from
Jul 20, 2022

Conversation

backport-action
Copy link
Collaborator

Description

Backport of #9759 to stable/8.0.

relates to #6778

Parallel gateways get activated by taking a sequence flow and checking if the number of taken flows is greater or equal to the number of incoming sequence flows. If this is the case an activate command is sent. The number of taken sequence flows get rest upon activation of the parallel gateway.

This proves troublesome when a "bad" model causes one of the incoming sequence flows to be taken twice. This could result in the activation command being sent twice. Imagine there is a parallel gateway with 2 incoming flows. What would happen is:

1. First flow is taken
2. Second flow is taken. Incoming flows == taken flows so an activate command is sent.
3. Second flow is taken again. The first activate command has not been processed yet. The number of taken flows has not been reset. As a result incoming flows < taken flows. A second activate command is sent.

(cherry picked from commit a14ce8c)
This check has been moved to the ProcessInstanceStateTransitionGuard. We can always send the activate command. If a parallel gateway cannot be activated the command gets rejected.
This might have a small impact on performance, as now we are sending commands and rejecting them, as opposed to not sending the commands at all.

(cherry picked from commit 016c280)
(cherry picked from commit 1f5a1dd)
Expand the test to also assert that we reject the command twice, and only activate it once.

(cherry picked from commit aa9fab1)
Copy link
Contributor

@remcowesterhoud remcowesterhoud left a comment

Choose a reason for hiding this comment

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

bors merge

zeebe-bors-camunda bot added a commit that referenced this pull request Jul 20, 2022
9823: [Backport stable/8.0] Reject duplicate parallel gateway activate command r=remcowesterhoud a=backport-action

# Description
Backport of #9759 to `stable/8.0`.

relates to #6778

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@remcowesterhoud
Copy link
Contributor

bors retry

zeebe-bors-camunda bot added a commit that referenced this pull request Jul 20, 2022
9823: [Backport stable/8.0] Reject duplicate parallel gateway activate command r=remcowesterhoud a=backport-action

# Description
Backport of #9759 to `stable/8.0`.

relates to #6778

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@remcowesterhoud
Copy link
Contributor

bors retry

zeebe-bors-camunda bot added a commit that referenced this pull request Jul 20, 2022
9823: [Backport stable/8.0] Reject duplicate parallel gateway activate command r=remcowesterhoud a=backport-action

# Description
Backport of #9759 to `stable/8.0`.

relates to #6778

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@remcowesterhoud
Copy link
Contributor

Come on bors ...

bors retry

@oleschoenburg
Copy link
Member

docker hub is having issues https://status.docker.com/pages/history/533c6539221ae15e3f000031

@remcowesterhoud
Copy link
Contributor

remcowesterhoud commented Jul 20, 2022

I figured it would be something like this. I'll try again later. Thanks 😄

@zeebe-bors-camunda
Copy link
Contributor

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit c8c465d into stable/8.0 Jul 20, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the backport-9759-to-stable/8.0 branch July 20, 2022 12:15
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.

None yet

3 participants