-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Extend job executor acquisition to work with rootProcessInstanceId
#4004
Comments
Investigation UpdateContext: I've tried to add a test to
Problems
Here is the Exception[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 102.801 s <<< FAILURE! - in org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest [ERROR] testJobAcquisitionWithCallActivitySubProcesses(org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest) Time elapsed: 102.801 s <<< ERROR! org.camunda.bpm.engine.ProcessEnginePersistenceException: An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace. at org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest.areJobsAvailable(ExclusiveOverProcessHierarchiesTest.java:203) at org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest.lambda$waitForJobExecutorToProcessAllJobs$0(ExclusiveOverProcessHierarchiesTest.java:172) at org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest.waitForCondition(ExclusiveOverProcessHierarchiesTest.java:188) at org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest.waitForJobExecutorToProcessAllJobs(ExclusiveOverProcessHierarchiesTest.java:172) at org.camunda.bpm.qa.upgrade.scenarios7210.jobexecutor.ExclusiveOverProcessHierarchiesTest.testJobAcquisitionWithCallActivitySubProcesses(ExclusiveOverProcessHierarchiesTest.java:104) Caused by: org.apache.ibatis.exceptions.PersistenceException:Error querying database. Cause: java.sql.SQLException: PooledDataSource: Unknown severe error condition. The connection pool returned a null connection.The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Job.xmlThe error may involve org.camunda.bpm.engine.impl.persistence.entity.JobEntity.selectJobByQueryCriteriaThe error occurred while executing a queryCause: java.sql.SQLException: PooledDataSource: Unknown severe error condition. The connection pool returned a null connection.
Caused by: java.sql.SQLException: PooledDataSource: Unknown severe error condition. The connection pool returned a null connection. |
Investigation UpdateContext: (A) db-instance-migration tests
Solution: An alternative approach to overcome the limitations of the db migration tests is to use the
Context: (B) Unit Test having the new configuration disabled have more acquisition entries than the expected (5 instead of 4) |
Investigation UpdateProblem (A):
|
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
Merged feature to |
Acceptance Criteria (Required on creation)
ROOT_PROCESS_INSTANCE_
in tableACT_RU_JOB
. Add it for all the databases.ACT_IDX_JOB_ROOT_PROCINST
processInstanceId
as fallback in case therootProcessInstanceId
isnull
.jobExecutorAcquireExclusiveOverProcessHierarchies
and set it to false by defaultAdd a Unit Test for testing Job Acquisition given a Root Process that calls a Subprocess (1 level deep) with the feature disabled
Add a Unit Test for testing Job Acquisition given a Root Process that calls a Subprocess (1 level deep) with the feature enabled*
Add Unit Test for testing Job Acquisition given a Root Process that calls a Subprocess which calls another Subprocess (2 levels deep) with the feature enabled*
Add
db-instance-migration
Test which tests a a given Root Process that calls a Subprocess (1 level deep) created in7.20
null
rootProcessId
of a process definition, created before the feature and guarantee the acquisition works with the legacy behaviour when the feature is disabled by defaultAdd
db-instance-migration
Test which tests a given Root Process that calls a Subprocess (1 level deep) created in7.20
with the feature enabled*Feature enabled*:
jobExecutorAcquireExclusiveOverProcessHierarchies=true
Hints
Links
Breakdown
Tasks
The text was updated successfully, but these errors were encountered: