Allow Skyframe graph lookups and value retrievals to throw InterruptedException.
The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer.
--
MOS_MIGRATED_REVID=130327770
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternsResultBuilder.java b/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternsResultBuilder.java
index 575a0ff..3d0acf0 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternsResultBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternsResultBuilder.java
@@ -23,7 +23,6 @@
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.skyframe.WalkableGraph;
-
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -43,10 +42,9 @@
hasError = true;
}
- /**
- * Returns final set of targets and sets error flag if required.
- */
- public ResolvedTargets<Target> build(WalkableGraph walkableGraph) throws TargetParsingException {
+ /** Returns final set of targets and sets error flag if required. */
+ public ResolvedTargets<Target> build(WalkableGraph walkableGraph)
+ throws TargetParsingException, InterruptedException {
precomputePackages(walkableGraph);
ResolvedTargets.Builder<Target> resolvedTargetsBuilder = buildInternal();
if (hasError) {
@@ -74,7 +72,7 @@
return resolvedTargetsBuilder;
}
- private void precomputePackages(WalkableGraph walkableGraph) {
+ private void precomputePackages(WalkableGraph walkableGraph) throws InterruptedException {
Set<PackageIdentifier> packagesToRequest = getPackagesIdentifiers();
packages = Maps.newHashMapWithExpectedSize(packagesToRequest.size());
for (PackageIdentifier pkgIdentifier : packagesToRequest) {
@@ -102,8 +100,8 @@
return packagesIdentifiers;
}
- private Package findPackageInGraph(PackageIdentifier pkgIdentifier,
- WalkableGraph walkableGraph) {
+ private static Package findPackageInGraph(
+ PackageIdentifier pkgIdentifier, WalkableGraph walkableGraph) throws InterruptedException {
return Preconditions.checkNotNull(
((PackageValue) walkableGraph.getValue(PackageValue.key(pkgIdentifier))), pkgIdentifier)
.getPackage();