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

Exclusive jobs spanning across multi-instance call activities #316

Open
1 task done
engineering-issue-sync-app bot opened this issue Oct 5, 2023 · 0 comments
Open
1 task done
Assignees
Labels
component:c7-automation-platform Issue affects the Camunda 7 automation platform public

Comments

@engineering-issue-sync-app
Copy link

engineering-issue-sync-app bot commented Oct 5, 2023

Value Proposition Statement 🚀

Allow advanced workflow patterns with exclusive jobs for tasks in multi-instance sub-processes.

User Problem 🤦

Context:

  • A process can start multiple "subprocesses" (via Multi-Instance Call Activity).

  • In certain scenarios, tasks in the subprocess should be executed exclusively as it, e.g., uses resources that do not allow it to be executed in parallel.

Problem:

  • The job executor cannot track exclusive jobs beyond one process instance as the parent process, and the called process will have different instance IDs

  • OptimisticLockingException (OLE) can occur.

  • The executor handles the OLEs, and the retries are not decreased (so no incidents occur due to this)

  • OLEs are not hindering exceptions, but they still appear again and again in the same place and are also visible in the log

  • Current workaround: The business team defines special retry time cycles at certain points to perform retries faster.

User Stories 🧑‍🚀

As a developer, I want to use an exclusive continuation for tasks in a multi-instance sub-process to ensure a task is not executed in parallel.

Implementation 👷

Solution outline

  • Add root process instance id column to the runtime job table.
  • Replace the process instance id with the root process instance id for the process instance and the runtime job in the condition of the job acquisition query.
    • For the top-level process instance, root process instance id == process instance id so the previous behavior is maintained.
  • Since jobs already run on a previous Camunda version the root process instance is null.
    • A fallback to the process instance id columns is needed.

Open questions

  • Is it problematic to roll out this new behavior to all the users? Are there cases in which this behavior is problematic or undesired?
    • The performance for jobs with no root process instance id populated degrades since the job acquisition query is more complex; is this acceptable?
    • Are there users that want to maintain the current behavior? Since nobody has asked for this new behavior, the answer is probably yes.
  • Should we make this configurable? In the process engine config or on the BPMN model level?

Implementation Notes

Tasks

  1. 2 of 2
    type:feature version:7.21.0 version:7.21.0-alpha5
    psavidis

🤖 This issue is automatically synced from: source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:c7-automation-platform Issue affects the Camunda 7 automation platform public
Projects
None yet
Development

No branches or pull requests

3 participants