camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.11k stars 1.55k forks source link

JobExecutor does not execute jobs with negative priorities #3066

Closed mboskamp closed 1 year ago

mboskamp commented 1 year ago

Environment (Required on creation)

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

When I use negative values for job priorities, the jobs would be executed by the job executor before 7.18.2. On 7.18.2 those jobs are never picked up for execution.

Steps to reproduce (Required on creation)

  1. Create a process with a negative job priority (camunda:jobPriority="-20" on process level will configure it globally).
  2. Start an instance of that process with 7.18.2.
  3. Observe that no jobs are executed

Observed Behavior (Required on creation)

Jobs with negative priority are not executed on 7.18.2

Expected behavior (Required on creation)

Jobs with negative priority are executed on 7.18.2

Root Cause (Required on prioritization)

When the initial feature "I can assign the job executor to a job priority range" (CAM-13486) was developed, negative job priorities were not considered. When we changed the data type of the min and max properties from Long to long with #2826, the priority ranges were activated by default. This which would be not a problem if they would reflect the whole range of possible values. Since only values between 0 (including) and MAX_VALUE (including) are allowed this leads to the situation where jobs with negative values are not picked up.

Solution Ideas

Hints

This should be added to the migration guide.

Links

https://jira.camunda.com/browse/SUPPORT-15558

Breakdown

Fixes after merge

Dev2QA handover

mboskamp commented 1 year ago

I will do the backporting once #3078 has been reviewed.

mboskamp commented 1 year ago

@danielkelemen, all remaining PRs are ready for review

tasso94 commented 1 year ago

@mboskamp, heads-up to add version: labels.