Skip to content

Commit 12d6875

Browse files
fmeumcopybara-github
authored andcommitted
Don't block within futures in MerkleTreeComputer
Only the outer `buildForFiles`/`buildForSpawn` entry points may block on futures now. This fixes deadlocks that could happen when all threads in `MERKLE_TREE_BUILD_POOL` block on futures scheduled on this pool. The existing golden test now builds the same Merkle tree multiple times concurrently, which reproduces the deadlock before this change on virtually every run and passes in 100 attempts with the fix. Fixes bazelbuild#27331 Closes bazelbuild#27345. PiperOrigin-RevId: 823843469 Change-Id: I3a6fa7e849df4506eed8646e8c93e86515999aae
1 parent 2bc4ca2 commit 12d6875

File tree

3 files changed

+218
-178
lines changed

3 files changed

+218
-178
lines changed

src/main/java/com/google/devtools/build/lib/remote/merkletree/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ java_library(
2828
"//src/main/java/com/google/devtools/build/lib/remote/util",
2929
"//src/main/java/com/google/devtools/build/lib/remote/util:digest_utils",
3030
"//src/main/java/com/google/devtools/build/lib/skyframe:tree_artifact_value",
31+
"//src/main/java/com/google/devtools/build/lib/util:TestType",
3132
"//src/main/java/com/google/devtools/build/lib/util:string_encoding",
3233
"//src/main/java/com/google/devtools/build/lib/vfs",
3334
"//src/main/java/com/google/devtools/build/lib/vfs:pathfragment",

0 commit comments

Comments
 (0)