Skip to content

Performance: parallel_services thread pool is unbounded (no parallel_max_workers cap) #153

@tcconnally

Description

@tcconnally

Severity: 🟡 Medium (performance; thread pool exhaustion)

@query parallel mode has a hard cap of 8 workers (renderer.py:645):

with ThreadPoolExecutor(max_workers=min(len(pending), 8)) as executor:

@services parallel mode (render.parallel_services: True, config.py:25) should have a matching cap. Locate the @services pre-scan/parallel block (likely directives/services.py) and apply max_workers=min(N, cfg.render.parallel_max_workers or 8).

Also add render.parallel_max_workers: 8 to DEFAULT_CONFIG so both @query and @services honor a single tunable.

Acceptance criteria

  • Code search: every ThreadPoolExecutor(...) in the codebase uses the same parallel_max_workers knob.
  • Test: setting parallel_max_workers: 2 caps both @query and @services at 2 concurrent workers.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions