Skip to content

Fix worker count calculation to return at least one worker on single-CPU hosts #1509

@coderabbitai

Description

@coderabbitai

Problem

The _get_num_workers() method in components/clp-package-utils/clp_package_utils/controller.py currently returns multiprocessing.cpu_count() // 2, which evaluates to 0 on single-CPU hosts. This would prevent workers from starting properly.

Location

components/clp-package-utils/clp_package_utils/controller.py, lines 791-797 (as of PR #1502)

Impact

On systems with a single CPU core, no workers would be started, causing CLP components to fail.

Solution

Ensure the method returns at least 1 worker by flooring the result to a minimum of 1.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions