-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "[engine] Limit number of active subprocesses"
This reverts commit 0dae038. Reason for revert: There was a potential for deadlocks in the first version of this change. Previously, the semaphore used to limit the number of running subprocesses wouldn't get released, allowing another subproces to start, until the subprocess completed *and* the `wait()` Starlark function was called on the subprocess object. This meant that it was not safe to launch a large number of subprocesses and then call `wait()` on them in any order other than the same order in which they were started. Otherwise the code would run the risk of calling `wait()` on a subprocess that couldn't start until another subprocess had `wait()` called on it, leading to a deadlock. Now the semaphore gets released by a separate goroutine immediately after the subprocess completes, even if the Starlark code hasn't called `wait()` yet, making this class of deadlock impossible. Original change's description: > Revert "[engine] Limit number of active subprocesses" > > This reverts commit 612779b. > > Reason for revert: `shac check --all` is hanging in large repos: > https://ci.chromium.org/b/8767597391211255425 > > Original change's description: > > [engine] Limit number of active subprocesses > > > > Previously the number of concurrent subprocess invocations launched by > > `ctx.os.exec()` was unbounded, which could place a strain on the system. > > Now there's effectively a pool of NumCPU+2 workers for running > > subprocesses. > > > > `ctx.os.exec()` returns immediately, but the underlying subprocess is > > started asynchronously. > > > > `ba -against main` showed no significant difference in the results of > > the `ctx.os.exec()` benchmarks. > > > > Change-Id: I76e4542249783c9a503f0f927e327e9f90f8bb04 > > Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/867979 > > Reviewed-by: Ina Huh <[email protected]> > > Commit-Queue: Oliver Newman <[email protected]> > > Change-Id: Icfd3611825b1995948c856170ddc353b7ebfb1eb > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/929633 > Fuchsia-Auto-Submit: Oliver Newman <[email protected]> > Commit-Queue: Auto-Submit <[email protected]> > Reviewed-by: RubberStamper 🤖 <[email protected]> Change-Id: Iefdd7aebc04d03e60f925f136a08eebc28e5bb63 Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/929654 Reviewed-by: Ina Huh <[email protected]> Fuchsia-Auto-Submit: Oliver Newman <[email protected]> Commit-Queue: Auto-Submit <[email protected]>
- Loading branch information
Showing
5 changed files
with
66 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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