fix(analyzer): bound file analysis workers - #8058
Conversation
|
I have tested this fix against my repo where the issue was occurring - the issue is no longer reproducible |
|
Hi @omribz156, I've also verified this resolves the thread-exhaustion crash cleanly and the bounded-pool wiring (channel-fed workers, wg.Add/wg.Done moved to the pool level) is correct, including preserving the existing unwanted-channel drain race handling in computeValues that I've introduced earlier this year. One addition I would propose: the added test to analyzer_test only covers Let me know what you think and thanks again for your help improving kics! P.S: I can address the changes on my side and close this PR once we merge the changes, mentioning both the issue and the original pull request. |
|
Commits do need to be signed in order for any pull request to be merged. If this is something that you cannot achieve on your side, I will open the PR on my side and tag you, as well as the pull request and related issue as well. Let me know if you could sign the commits on your side @omribz156. |
|
Hi @omribz156, The bounded pool implementation looks good. Let me know what you think and thanks again for your help improving KICS! |
2880735 to
8724dcd
Compare
… library embedders
* fix(analyzer): bound file analysis workers * test: cover bounded analyzer worker concurrency * update: add MaxAnalyzerWorkers to Analyzer providing better usage for library embedders --------- Co-authored-by: Artur Ribeiro <153724638+cx-artur-ribeiro@users.noreply.github.com>
Closes #8046
Reason for Proposed Changes
Proposed Changes
GOMAXPROCS, capped at 128 workers and never larger than the candidate file count.Verification
go test ./pkg/analyzer -count=1go test ./pkg/scan -run "Test.*Analyze|Test.*Init|Test.*Prepare" -count=1git diff --checkThis was implemented with Codex assistance, with the final patch kept focused and manually reviewed.
I submit this contribution under the Apache-2.0 license.