-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(engine): Support Exclusive Jobs across Process Hierarchies
Context: Exclusive jobs that originate from process hierarchies (processes which contain multi-instance subprocesses) can now be executed exclusively. Why: The exclusive execution would only be applied on tasks that originate at a root level. Any subprocess spawned by root processes would not be correlated and considered for exclusive execution. Changes: See below the changes of this feature - New column `ROOT_PROC_INST_ID_ ` is introduced to correlated a process instance with its root parent - The column is added to all supported databases & `7.20_to_7.21` migration scripts. - The query `selectNextJobsToExecute` is enriched to consider the root process instance id when the feature is enabled. - The feature flag `jobExecutorAcquireExclusiveOverProcessHierarchies` enables / disables the feature. - The feature is disabled by default for backwards compatibility with the legacy behaviour. Tests: - Unit tests under `ExclusiveJobAcquisitionTest` which cover: - Legacy behaviour with the feature disabled - Feature behaviour with the feature enabled & a 1-level deep process hierarchy (process which spawns a subprocess) - Feature behaviour with the feature enabled & a 2-level deep process hierarchy (process which spawns a subprocess - which spawns another subprocess) - Migration tests under `ExclusiveOverProcessHierarchiesTest` which cover: - How the job acquisition and execution (see `AcquireJobsCmd`) behave with existing 7.20 process instances when the feature is disabled (legacy behaviour and backwards compatibility) - How the job acquisition and execution (see `AcquireJobsCmd`) behave with existing 7.20 process instances when the feature is enabled (feature behaviour) - The tests need to select all the jobs and lock them to perform their logic. After the test execution the jobs are unlocked. Other Notable Changes: - Fixed flakiness of `DecisionDefinitionTest` - The Test class was susceptible to timezone changes due its test data using the current date; as a result, depending on the date of execution, changing to DST could fail the tests. - This behaviour is fixed by adjusting the test data to use a fixed past date, rendering the test executions immune to date of execution. - The waiting behaviour on jobs for the tests to rely on the scheduler, shared by `SequentialJobAcquisitionTest`, `ExclusiveJobAcquisitionTest` is extracted into class `JobExecutorWaitUtils` Co-authored-by: daniel.kelemen Co-authored-by: yanavasileva Co-authored-by: petros.savvidis Related-to: #4004 , #4003
- Loading branch information
Showing
42 changed files
with
1,138 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.