Skip to content

feat(FOUR-33043): Define a maxJobs and memory limit for BPMN and default - #9050

Open
pmPaulis wants to merge 2 commits into
developfrom
FOUR-33043
Open

feat(FOUR-33043): Define a maxJobs and memory limit for BPMN and default#9050
pmPaulis wants to merge 2 commits into
developfrom
FOUR-33043

Conversation

@pmPaulis

@pmPaulis pmPaulis commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

Define a maxJobs and memory limit for BPMN and default

Solution

  • We defined a new .env variables to define the maxJobs

Current behavior is not possible to define this value and per default is 0 like

PM4_HORIZON_SUPERVISOR_BPMN_MAX_JOBS=0
PM4_HORIZON_SUPERVISOR_1_MAX_JOBS=0 
PM4_HORIZON_SUPERVISOR_BPMN_MAX_JOBS=10
PM4_HORIZON_SUPERVISOR_1_MAX_JOBS=100

How to Test

Describe how to test that this solution works.

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@cursor

cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
New default maxJobs values change queue worker lifecycle in all environments unless env is overridden, which can affect throughput and restart timing for BPMN and general queues.

Overview
Adds configurable Horizon worker job limits so BPMN and default queue supervisors can recycle workers after a set number of jobs.

config/horizon.php now sets maxJobs on supervisor-bpmn and supervisor-1 for production, local, and staging, driven by PM4_HORIZON_SUPERVISOR_BPMN_MAX_JOBS (default 10) and PM4_HORIZON_SUPERVISOR_1_MAX_JOBS (default 100). Setting either env var to 0 disables the limit. .env.example documents the new variables.

Unit/integration coverage in HorizonConfigTest asserts defaults, env overrides (including zero), and that queue:work --max-jobs processes a batch of jobs across multiple worker runs.

Reviewed by Cursor Bugbot for commit 0f19b1f. Bugbot is set up for automated code reviews on this repo. Configure here.

@pmPaulis
pmPaulis requested a review from caleeli September 8, 2026 22:14
@pmPaulis pmPaulis self-assigned this Sep 8, 2026
cursor[bot]

This comment was marked as resolved.

@decisions-sonarqube

Copy link
Copy Markdown

@caleeli caleeli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for QA (Alejandro) do some performance tests to make sure this did not impact scripts performance executing at least 30 scripts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants