diff options
author | 2016-08-15 21:54:55 +0000 | |
---|---|---|
committer | 2016-08-16 15:21:17 +0000 | |
commit | 3c0adb26bac6d756fb97e4bcc6d4e5b2cefa5eeb (patch) | |
tree | c77f6438711f4b23d6c528907a81e23dc9e6dc91 /src/main/java/com/google/devtools/build/lib/analysis/BuildView.java | |
parent | 89125d5ee83f562c309a792a7c56ce24452e61ea (diff) |
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
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/BuildView.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/BuildView.java | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java index 5fed4a32fa..8b5eb241b8 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java @@ -81,7 +81,6 @@ import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.WalkableGraph; import com.google.devtools.common.options.Option; import com.google.devtools.common.options.OptionsBase; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -568,19 +567,26 @@ public class BuildView { String error = createErrorMessage(loadingResult, skyframeAnalysisResult); final WalkableGraph graph = skyframeAnalysisResult.getWalkableGraph(); - final ActionGraph actionGraph = new ActionGraph() { - @Nullable - @Override - public ActionAnalysisMetadata getGeneratingAction(Artifact artifact) { - ArtifactOwner artifactOwner = artifact.getArtifactOwner(); - if (artifactOwner instanceof ActionLookupValue.ActionLookupKey) { - SkyKey key = ActionLookupValue.key((ActionLookupValue.ActionLookupKey) artifactOwner); - ActionLookupValue val = (ActionLookupValue) graph.getValue(key); - return val == null ? null : val.getGeneratingAction(artifact); - } - return null; - } - }; + final ActionGraph actionGraph = + new ActionGraph() { + @Nullable + @Override + public ActionAnalysisMetadata getGeneratingAction(Artifact artifact) { + ArtifactOwner artifactOwner = artifact.getArtifactOwner(); + if (artifactOwner instanceof ActionLookupValue.ActionLookupKey) { + SkyKey key = ActionLookupValue.key((ActionLookupValue.ActionLookupKey) artifactOwner); + ActionLookupValue val; + try { + val = (ActionLookupValue) graph.getValue(key); + } catch (InterruptedException e) { + throw new IllegalStateException( + "Interruption not expected from this graph: " + key, e); + } + return val == null ? null : val.getGeneratingAction(artifact); + } + return null; + } + }; return new AnalysisResult( configuredTargets, aspects, |