Skip to content

fix(analyzer): bound file analysis workers#8058

Open
omribz156 wants to merge 1 commit into
Checkmarx:masterfrom
omribz156:codex/analyzer-bounded-workers
Open

fix(analyzer): bound file analysis workers#8058
omribz156 wants to merge 1 commit into
Checkmarx:masterfrom
omribz156:codex/analyzer-bounded-workers

Conversation

@omribz156
Copy link
Copy Markdown

Closes #8046

Reason for Proposed Changes

  • The analyzer currently starts one goroutine per candidate file.
  • On very large repositories, that can create tens of thousands of goroutines during "Preparing Scan Assets" and trigger the thread-exhaustion crash reported in the issue.

Proposed Changes

  • Replace per-file goroutine spawning with a bounded worker pool.
  • Size the pool from GOMAXPROCS, capped at 128 workers and never larger than the candidate file count.
  • Add unit coverage for the worker-count helper.

Verification

  • go test ./pkg/analyzer -count=1
  • go test ./pkg/scan -run "Test.*Analyze|Test.*Init|Test.*Prepare" -count=1
  • git diff --check

This was implemented with Codex assistance, with the final patch kept focused and manually reviewed.

I submit this contribution under the Apache-2.0 license.

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.

bug(core): thread exhaustion when scanning large repositories

1 participant