Skip to content

Conversation

@vitormattos
Copy link
Member

No description provided.

@vitormattos vitormattos added this to the Next Major (34) milestone Jan 23, 2026
@vitormattos vitormattos self-assigned this Jan 23, 2026
@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Jan 23, 2026
Introduces WorkerJobCounter class that counts pending SignFileJob and
SignSingleFileJob instances using IJobList::countByClass(). This enables
the worker system to make informed decisions about how many workers to
start based on actual workload.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Changes worker stop_after parameter from 1h to 30m to reduce resource
consumption and allow for more frequent worker refreshes.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Integrate WorkerJobCounter to check pending work before starting workers
- Start only the minimum number of workers needed (min of pending jobs and desired workers)
- Return early with 0 workers if no pending jobs exist
- Rename constructor parameters to follow class naming convention
- Extract business logic into self-documenting methods:
  * hasNoPendingWork(): checks if there are jobs to process
  * limitWorkersByAvailableWork(): calculates workers needed
- Move WorkerHealthService to correct Worker namespace
- Add isAsyncLocalEnabled() public method

This reduces unnecessary worker spawning and improves resource efficiency.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Adds 8 test cases covering:
- Zero pending jobs
- Counting SignFileJob instances
- Counting SignSingleFileJob instances
- Summing both job types
- Ignoring other job types
- Exception handling
- Empty array handling
- Large number handling

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Adds test cases for:
- No workers started when no pending jobs exist
- Starting only needed workers based on pending job count
- Limiting workers by both pending jobs and running workers
- Starting fewer workers when less jobs than gap
- Starting one worker when only one job pending
- Proper handling when async local is disabled

Updates all mock properties to follow class naming convention.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update imports in SignFileController and FileProgressController to use
the correct Worker namespace for WorkerHealthService after moving the
class to lib/Service/Worker/

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the feat/optimize-worker-initialization branch from a091de7 to a37b742 Compare January 23, 2026 17:58
@vitormattos
Copy link
Member Author

/backport to stable33

@vitormattos
Copy link
Member Author

/backport to stable32

@vitormattos vitormattos merged commit 6fd039d into main Jan 23, 2026
50 of 52 checks passed
@vitormattos vitormattos deleted the feat/optimize-worker-initialization branch January 23, 2026 18:00
@github-project-automation github-project-automation bot moved this from 0. Needs triage to 4. to release in Roadmap Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

2 participants