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

Interrupt flow scope when a terminate end event is reached #11178

Merged
3 commits merged into from
Dec 7, 2022

Conversation

remcowesterhoud
Copy link
Contributor

@remcowesterhoud remcowesterhoud commented Dec 5, 2022

Description

The terminate end event should mark its flow scope as interrupted when it's completed. Having an interrupted flow scope means other elements in this scope can no longer be activated or completed. Any ACTIVATE/COMPLETE command will be rejected.

If we do not interrupt the flowscope it is possible for the engine write a TERMINATE command as a result of the end event. It could then go on to process a COMPLETE command. This will not be rejected, and it will take outgoing sequence flows for this element. The TERMINATE will then be rejected as the element is no longer active. Since the flowscope now has an outgoing sequence flows it is considered to have active elements, it will not be terminated, as it should upon reaching a terminate end event.

Since the flow scope gets interrupted we will also have to change the logic in the processors of these possible flow scopes (ProcessProcessor, SubProcessProcessors, EventSubProcessProcessor). Here we need to verify that the scope was interrupted by a terminate end event, and if it is we need to make sure the scope gets completed, instead of terminated.

Related issues

relates to #11121

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

The terminate end event should mark its flow scope as interrupted when it's completed. Having an interrupted flow scope means other elements in this scope can no longer be activated or completed. Any ACTIVATE/COMPLETE command will be rejected.

If we do not interrupt the flowscope it is possible for the engine write a TERMINATE command as a result of the end event. It could then go on to process a COMPLETE command. This will not be rejected, and it will take outgoing sequence flows for this element. The TERMINATE will then be rejected as the element is no longer active. Since the flowscope now has an outgoing sequence flows it is considered to have active elements, it will not be terminated, as it should upon reaching a terminate end event.
The terminate end event will have marked the process as interrupted. When a terminate end event is reached we expect its flowscope to be completed, not terminated. Therefore, we need to check if the process was interrupted because of a terminate end event. If this is the case we should try to complete the process.
…te end event

The terminate end event will have marked the (event) sub process as interrupted. When a terminate end event is reached we expect its flowscope to be completed, not terminated. Therefore, we need to check if the (event) sub process was interrupted because of a terminate end event. If this is the case we should complete it
@remcowesterhoud
Copy link
Contributor Author

@koevskinikola As we discussed last week during the flaky test session I'll assign this review to you. Don't hesitate to reach out if anything is unclear. I'm happy to explain it 🙂

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

Test Results

   971 files  ±    0     971 suites  ±0   1h 55m 0s ⏱️ + 4m 24s
8 026 tests +238  8 019 ✔️ +238  7 💤 ±0  0 ±0 
8 232 runs  +238  8 223 ✔️ +238  9 💤 ±0  0 ±0 

Results for commit 89e6d9b. ± Comparison against base commit 3c4c3a5.

@remcowesterhoud
Copy link
Contributor Author

I'm not having this PR close #11121 yet. I believe there is more flaky scenarios that are not covered by this bug fix

Copy link
Member

@koevskinikola koevskinikola left a comment

Choose a reason for hiding this comment

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

👍 @remcowesterhoud, the changes look good to me, but I'd like to do a short call to ensure that I understood everything correctly.

🔧 Should we re-enable the Escalation event Block builder within this PR since it was disabled here? => Answered in the previous comment.

@remcowesterhoud
Copy link
Contributor Author

Let's do a call tomorrow.

I want to wait re-enabling this block builders. I believe there is another bug hidden somewhere for which I will make a PR tomorrow 😄

Copy link
Member

@koevskinikola koevskinikola left a comment

Choose a reason for hiding this comment

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

👍 Thanks for the explanation @remcowesterhoud. I have a better understanding on what is happening now.

LGTM 🚀

bors merge

@ghost
Copy link

ghost commented Dec 7, 2022

Build succeeded:

@ghost ghost merged commit e81c8ab into main Dec 7, 2022
@ghost ghost deleted the 11121_flaky_randomized_test branch December 7, 2022 10:49
@backport-action
Copy link
Collaborator

Successfully created backport PR #11214 for stable/8.1.

ghost pushed a commit that referenced this pull request Dec 7, 2022
11214: [Backport stable/8.1] Interrupt flow scope when a terminate end event is reached r=remcowesterhoud a=backport-action

# Description
Backport of #11178 to `stable/8.1`.

relates to #11121

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
ghost pushed a commit that referenced this pull request Dec 7, 2022
11214: [Backport stable/8.1] Interrupt flow scope when a terminate end event is reached r=remcowesterhoud a=backport-action

# Description
Backport of #11178 to `stable/8.1`.

relates to #11121

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@Zelldon Zelldon added the version:8.1.6 Marks an issue as being completely or in parts released in 8.1.6 label Jan 4, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:8.1.6 Marks an issue as being completely or in parts released in 8.1.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants