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/ConfiguredTargetFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
index 9a82ef4..0bd188a 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
@@ -75,7 +75,6 @@
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.build.skyframe.ValueOrException;
import com.google.devtools.build.skyframe.ValueOrException2;
-
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
@@ -84,7 +83,6 @@
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
-
import javax.annotation.Nullable;
/**
@@ -416,15 +414,18 @@
* transitive closure.
*
* <p>This method is heavily performance-optimized. Because it, in aggregate, reads over every
- * edge in the configured target graph, small inefficiencies can have observable impact on
- * build analysis time. Keep this in mind when making modifications and performance-test any
- * changes you make.
+ * edge in the configured target graph, small inefficiencies can have observable impact on build
+ * analysis time. Keep this in mind when making modifications and performance-test any changes you
+ * make.
*/
@Nullable
- static OrderedSetMultimap<Attribute, Dependency> trimConfigurations(Environment env,
- TargetAndConfiguration ctgValue, OrderedSetMultimap<Attribute, Dependency> originalDeps,
- BuildConfiguration hostConfiguration, RuleClassProvider ruleClassProvider)
- throws DependencyEvaluationException {
+ static OrderedSetMultimap<Attribute, Dependency> trimConfigurations(
+ Environment env,
+ TargetAndConfiguration ctgValue,
+ OrderedSetMultimap<Attribute, Dependency> originalDeps,
+ BuildConfiguration hostConfiguration,
+ RuleClassProvider ruleClassProvider)
+ throws DependencyEvaluationException, InterruptedException {
// Maps each Skyframe-evaluated BuildConfiguration to the dependencies that need that
// configuration. For cases where Skyframe isn't needed to get the configuration (e.g. when
@@ -684,7 +685,7 @@
Map<SkyKey, ConfiguredTarget> configuredTargetMap,
Iterable<Dependency> deps,
NestedSetBuilder<Package> transitivePackages)
- throws AspectCreationException {
+ throws AspectCreationException, InterruptedException {
OrderedSetMultimap<SkyKey, ConfiguredAspect> result = OrderedSetMultimap.create();
Set<SkyKey> aspectKeys = new HashSet<>();
for (Dependency dep : deps) {
@@ -766,18 +767,21 @@
}
/**
- * Returns the set of {@link ConfigMatchingProvider}s that key the configurable attributes
- * used by this rule.
+ * Returns the set of {@link ConfigMatchingProvider}s that key the configurable attributes used by
+ * this rule.
*
- * <p>>If the configured targets supplying those providers aren't yet resolved by the
- * dependency resolver, returns null.
+ * <p>>If the configured targets supplying those providers aren't yet resolved by the dependency
+ * resolver, returns null.
*/
@Nullable
- static ImmutableMap<Label, ConfigMatchingProvider> getConfigConditions(Target target,
- Environment env, SkyframeDependencyResolver resolver, TargetAndConfiguration ctgValue,
+ static ImmutableMap<Label, ConfigMatchingProvider> getConfigConditions(
+ Target target,
+ Environment env,
+ SkyframeDependencyResolver resolver,
+ TargetAndConfiguration ctgValue,
NestedSetBuilder<Package> transitivePackages,
NestedSetBuilder<Label> transitiveLoadingRootCauses)
- throws DependencyEvaluationException {
+ throws DependencyEvaluationException, InterruptedException {
if (!(target instanceof Rule)) {
return NO_CONFIG_CONDITIONS;
}
@@ -847,15 +851,19 @@
return ImmutableMap.copyOf(configConditions);
}
- /***
- * Resolves the targets referenced in depValueNames and returns their ConfiguredTarget instances.
+ /**
+ * * Resolves the targets referenced in depValueNames and returns their ConfiguredTarget
+ * instances.
*
* <p>Returns null if not all instances are available yet.
*/
@Nullable
private static Map<SkyKey, ConfiguredTarget> resolveConfiguredTargetDependencies(
- Environment env, Collection<Dependency> deps, NestedSetBuilder<Package> transitivePackages,
- NestedSetBuilder<Label> transitiveLoadingRootCauses) throws DependencyEvaluationException {
+ Environment env,
+ Collection<Dependency> deps,
+ NestedSetBuilder<Package> transitivePackages,
+ NestedSetBuilder<Label> transitiveLoadingRootCauses)
+ throws DependencyEvaluationException, InterruptedException {
boolean missedValues = env.valuesMissing();
boolean failed = false;
Iterable<SkyKey> depKeys = Iterables.transform(deps, TO_KEYS);