diff options
author | Janak Ramakrishnan <janakr@google.com> | 2016-08-15 21:54:55 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-08-16 15:21:17 +0000 |
commit | 3c0adb26bac6d756fb97e4bcc6d4e5b2cefa5eeb (patch) | |
tree | c77f6438711f4b23d6c528907a81e23dc9e6dc91 /src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.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/skyframe/FileFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java index 6eb962114c..8404f53aa7 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/FileFunction.java @@ -28,12 +28,10 @@ import com.google.devtools.build.skyframe.SkyFunctionException; import com.google.devtools.build.skyframe.SkyFunctionException.Transience; import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.SkyValue; - import java.io.IOException; import java.util.ArrayList; import java.util.TreeSet; import java.util.concurrent.atomic.AtomicReference; - import javax.annotation.Nullable; /** @@ -51,7 +49,8 @@ public class FileFunction implements SkyFunction { } @Override - public SkyValue compute(SkyKey skyKey, Environment env) throws FileFunctionException { + public SkyValue compute(SkyKey skyKey, Environment env) + throws FileFunctionException, InterruptedException { RootedPath rootedPath = (RootedPath) skyKey.argument(); RootedPath realRootedPath = null; FileStateValue realFileStateValue = null; @@ -132,9 +131,9 @@ public class FileFunction implements SkyFunction { * {@code null} if there was a missing dep. */ @Nullable - private Pair<RootedPath, FileStateValue> resolveFromAncestors( + private static Pair<RootedPath, FileStateValue> resolveFromAncestors( RootedPath rootedPath, Environment env) - throws FileFunctionException, FileOutsidePackageRootsException { + throws FileFunctionException, FileOutsidePackageRootsException, InterruptedException { PathFragment relativePath = rootedPath.getRelativePath(); RootedPath realRootedPath = rootedPath; FileValue parentFileValue = null; @@ -180,14 +179,17 @@ public class FileFunction implements SkyFunction { } /** - * Returns the symlink target and file state of {@code rootedPath}'s symlink to - * {@code symlinkTarget}, accounting for ancestor symlinks, or {@code null} if there was a - * missing dep. + * Returns the symlink target and file state of {@code rootedPath}'s symlink to {@code + * symlinkTarget}, accounting for ancestor symlinks, or {@code null} if there was a missing dep. */ @Nullable - private Pair<RootedPath, FileStateValue> getSymlinkTargetRootedPath(RootedPath rootedPath, - PathFragment symlinkTarget, TreeSet<Path> orderedSeenPaths, - Iterable<RootedPath> symlinkChain, Environment env) throws FileFunctionException { + private Pair<RootedPath, FileStateValue> getSymlinkTargetRootedPath( + RootedPath rootedPath, + PathFragment symlinkTarget, + TreeSet<Path> orderedSeenPaths, + Iterable<RootedPath> symlinkChain, + Environment env) + throws FileFunctionException, InterruptedException { RootedPath symlinkTargetRootedPath; if (symlinkTarget.isAbsolute()) { Path path = rootedPath.asPath().getFileSystem().getRootDirectory().getRelative( |