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

Use the ProcessInstanceBatch Command when terminating container elements #12538

Closed
Tracked by #12485
remcowesterhoud opened this issue Apr 24, 2023 · 0 comments · Fixed by #12604
Closed
Tracked by #12485

Use the ProcessInstanceBatch Command when terminating container elements #12538

remcowesterhoud opened this issue Apr 24, 2023 · 0 comments · Fixed by #12604
Assignees
Labels
area/reliability Marks an issue as related to improving the reliability of our software (i.e. it behaves as expected) component/engine kind/feature Categorizes an issue or PR as a feature, i.e. new behavior version:8.1.12 Marks an issue as being completely or in parts released in 8.1.12 version:8.2.4 Marks an issue as being completely or in parts released in 8.2.4 version:8.3.0-alpha1 Marks an issue as being completely or in parts released in 8.3.0-alpha1 version:8.3.0-alpha2 Marks an issue as being completely or in parts released in 8.3.0-alpha2 version:8.3.0 Marks an issue as being completely or in parts released in 8.3.0

Comments

@remcowesterhoud
Copy link
Contributor

remcowesterhoud commented Apr 24, 2023

Description

Container elements (process, subprocess, etc.) all terminate their child instances when onTerminate is called. For all these elements this method calls the BpmnStateTransitionBehavior#terminateChildInstances method. This method needs to be changed to make use of the new ProcessInstanceBatch command with the TERMINATE intent.

  • Modify the BpmnStateTransitionBehavior#terminateChildInstances :
    • Create a ProcessInstanceBatch record
      • batchElementInstanceKey will be the key of the container element
      • index will be empty as this is the first batch command
    • Write the a ProcessInstanceBatch.TERMINATE command using the created record
@remcowesterhoud remcowesterhoud added kind/feature Categorizes an issue or PR as a feature, i.e. new behavior area/reliability Marks an issue as related to improving the reliability of our software (i.e. it behaves as expected) component/engine labels Apr 24, 2023
@remcowesterhoud remcowesterhoud self-assigned this Apr 26, 2023
zeebe-bors-camunda bot added a commit that referenced this issue Apr 28, 2023
12596: Process `ProcessInstanceBatch.TERMINATE` commands r=koevskinikola a=remcowesterhoud

## Description

<!-- Please explain the changes you made here. -->
I recommend reviewing this per commit.

This PR introduces the `TerminateProcessInstanceBatchProcessor`. This will be used to take care of terminating child element instances in batches. The implementation of this processor required a couple of things:

1. We needed a way to iterate over a ColumnFamily with a prefix, starting at a specific suffix. For this I have added a new method to the `ColumnFamily` interface. This method is very similar to the `whileTrue` method which also takes a `startAtKey`. The only difference is that the new method passes the prefix, whereas the `whileTrue` method always passes a `DbNullKey' as prefix.
2. We needed a way to verify if we can write a command of a specific length. This will be used by the processor to determine if writing `TERMINATE` command for the next child will result in an `ExceededBatchRecordSizeException` or not. If it is we should not write this command.
3. We needed a method on the `ElementInstanceState` to allow us to perform an action for each the children of a specific element instance.
4. Finally, we need the processor itself. The processor will use all of the above to send as many `TERMINATE` commands as will fit in the batch. When it doesn't fit anymore it sends a follow-up batch command. This is repeated until TERMINATE commands are send for all children.


As the processor is not used yet there are no tests to verify if it works. These will be implemented when we actually start using the processor in #12538.

## Related issues

<!-- Which issues are closed by this PR or are related -->

blocked by #12542
closes #12539 



Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this issue May 1, 2023
12604: Terminate children using the new `ProcessInstanceBatch` command r=berkaycanbc a=remcowesterhoud

## Description

<!-- Please explain the changes you made here. -->

This PR switches the termination of child instances to use the new `ProcessInstanceBatch` command.

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #12538 
closes #11355 



Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this issue May 1, 2023
12616: [Backport release-8.3.0-alpha1] Terminate children using the new `ProcessInstanceBatch` command r=remcowesterhoud a=backport-action

# Description
Backport of #12604 to `release-8.3.0-alpha1`.

relates to #12538 #11355

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this issue May 1, 2023
12614: [Backport stable/8.1] Terminate children using the new `ProcessInstanceBatch` command r=remcowesterhoud a=backport-action

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

relates to #12538 #11355

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this issue May 2, 2023
12614: [Backport stable/8.1] Terminate children using the new `ProcessInstanceBatch` command r=remcowesterhoud a=backport-action

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

relates to #12538 #11355

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this issue May 2, 2023
12615: [Backport stable/8.2] Terminate children using the new `ProcessInstanceBatch` command r=remcowesterhoud a=backport-action

# Description
Backport of #12604 to `stable/8.2`.

relates to #12538 #11355

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@remcowesterhoud remcowesterhoud added version:8.3.0-alpha1 Marks an issue as being completely or in parts released in 8.3.0-alpha1 version:8.1.12 Marks an issue as being completely or in parts released in 8.1.12 version:8.2.4 Marks an issue as being completely or in parts released in 8.2.4 and removed version:8.3.0-alpha1 Marks an issue as being completely or in parts released in 8.3.0-alpha1 labels May 3, 2023
@lenaschoenburg lenaschoenburg added the version:8.3.0-alpha2 Marks an issue as being completely or in parts released in 8.3.0-alpha2 label Jun 7, 2023
@megglos megglos added the version:8.3.0 Marks an issue as being completely or in parts released in 8.3.0 label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/reliability Marks an issue as related to improving the reliability of our software (i.e. it behaves as expected) component/engine kind/feature Categorizes an issue or PR as a feature, i.e. new behavior version:8.1.12 Marks an issue as being completely or in parts released in 8.1.12 version:8.2.4 Marks an issue as being completely or in parts released in 8.2.4 version:8.3.0-alpha1 Marks an issue as being completely or in parts released in 8.3.0-alpha1 version:8.3.0-alpha2 Marks an issue as being completely or in parts released in 8.3.0-alpha2 version:8.3.0 Marks an issue as being completely or in parts released in 8.3.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants