Jobserver wrongly assumes that it will be able to read tokens for all available jobs on setup
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
https://github.com/llvm/llvm-project/blob/0ff0f52460531c0bfa213d0dcfa0cfb4ba61e934/llvm/lib/Support/Unix/Jobserver.inc#L42-L44
https://github.com/llvm/llvm-project/blob/0ff0f52460531c0bfa213d0dcfa0cfb4ba61e934/llvm/lib/Support/Unix/Jobserver.inc#L93-L103
This wrongly assumes that all tokens will be immediately available at setup time. However, it is entirely likely that the jobserver will be performing some tasks already, and therefore not all tokens will be immediately available, resulting in wrong estimation. In fact, it is entirely possible that all job tokens will be consumed at the time and therefore `NumJobs` will become 0 and the assertion will fail.
Contributor guide
Assessment
This issue has not been assessed yet.