Check for interrupts in RBuildFilesVisitor
Its inner loop is cpu bound, make sure that a lot of reverse deps doesn't overly
delay command cancellation (interrupts) from taking.
@@ -100,6 +100,11 @@ public class RBuildFilesVisitor extends ParallelQueryVisitor<SkyKey, PackageIden
Set<PackageIdentifier> keysToUseForResult = CompactHashSet.create();
Set<SkyKey> keysToVisitNext = CompactHashSet.create();
for (SkyKey rdep : Iterables.concat(reverseDeps)) {
+ // This loop is cpu bound, make sure we bail if asked.
+ if (Thread.interrupted()) {
+ throw new InterruptedException();
+ }
+
if (rdep.functionName().equals(SkyFunctions.PACKAGE)) {
if (resultUniquifier.unique(rdep)) {
keysToUseForResult.add((PackageIdentifier) rdep.argument());
