Limit/declare thread usage to bazel#245
Open
furtib wants to merge 3 commits into
Open
Conversation
Szelethus
reviewed
Jun 17, 2026
Szelethus
left a comment
Contributor
There was a problem hiding this comment.
I'd appreciate some more explanation, preferably in an issue on what problem we are solving here. I'll do my best to do my own research on this!
nettle
reviewed
Jun 19, 2026
| + ["--skip", SKIP_FILE] | ||
| + ["--config", CONFIG_FILE] | ||
| + [COMPILE_COMMANDS_ABSOLUTE] | ||
| + ["-j 1"] # Analysis of a single file should use a single thread! |
Collaborator
There was a problem hiding this comment.
I guess this has no much sense for per-file :)
And I would not recommend doing changes "just for the case" too.
Comment on lines
+46
to
+56
| def _codechecker_resource_set(_os_name, input_count): | ||
| """ | ||
| Requests thread count based on number of input files. | ||
|
|
||
| If requested thread count is higher than available | ||
| bazel schedules the job to run alone. | ||
| This may not work with remote machines. | ||
| """ | ||
| return { | ||
| "cpu": input_count, # analysis is run for most input files | ||
| } |
Collaborator
There was a problem hiding this comment.
Interesting! And this may actually help to improve performance!
But we should be sure... Need measurement results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
Bazel expects its actions to use 1 thread by default.
This can result in it scheduling multiple long analysis jobs on the same machine, each trying to hog resources from the others.
What:
Addresses:
#246