Delete debugging code used to diagnose bug when shared actions raced to execute.

--
MOS_MIGRATED_REVID=91007686
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
index 631d6cb..3230af8 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
@@ -24,7 +24,6 @@
 import com.google.devtools.build.lib.actions.cache.DigestUtils;
 import com.google.devtools.build.lib.actions.cache.Metadata;
 import com.google.devtools.build.lib.actions.cache.MetadataHandler;
-import com.google.devtools.build.lib.util.LoggingUtil;
 import com.google.devtools.build.lib.util.io.TimestampGranularityMonitor;
 import com.google.devtools.build.lib.vfs.FileStatus;
 import com.google.devtools.build.lib.vfs.FileStatusWithDigest;
@@ -41,7 +40,6 @@
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Level;
 
 import javax.annotation.Nullable;
 
@@ -72,8 +70,6 @@
   private final ConcurrentMap<Artifact, FileArtifactValue> additionalOutputData =
       new ConcurrentHashMap<>();
   private final Set<Artifact> injectedArtifacts = Sets.newConcurrentHashSet();
-  private boolean metadataDiscarded = false;
-  private final Map<Artifact, StackTraceElement[]> missingArtifacts = new ConcurrentHashMap<>();
   private final ImmutableSet<Artifact> outputs;
   private final TimestampGranularityMonitor tsgm;
 
@@ -174,9 +170,6 @@
     fileValue = fileValueFromArtifact(artifact, null, tsgm);
     FileValue oldFileValue = outputArtifactData.putIfAbsent(artifact, fileValue);
     checkInconsistentData(artifact, oldFileValue, value);
-    if (metadataDiscarded && !fileValue.exists()) {
-      missingArtifacts.put(artifact, new Throwable().getStackTrace());
-    }
     return maybeStoreAdditionalData(artifact, fileValue, null);
   }
 
@@ -250,9 +243,6 @@
         byte[] fileDigest = fileValue.getDigest();
         Preconditions.checkState(fileDigest == null || Arrays.equals(digest, fileDigest),
             "%s %s %s", artifact, digest, fileDigest);
-        if (!fileValue.exists()) {
-          missingArtifacts.put(artifact, new Throwable().getStackTrace());
-        }
         outputArtifactData.put(artifact, fileValue);
       } catch (IOException e) {
         // Do nothing - we just failed to inject metadata. Real error handling will be done later,
@@ -295,18 +285,8 @@
   public void discardMetadata(Collection<Artifact> artifactList) {
     Preconditions.checkState(injectedArtifacts.isEmpty(),
         "Artifacts cannot be injected before action execution: %s", injectedArtifacts);
-    metadataDiscarded = true;
     outputArtifactData.keySet().removeAll(artifactList);
     additionalOutputData.keySet().removeAll(artifactList);
-    missingArtifacts.keySet().removeAll(artifactList);
-    if (!outputArtifactData.isEmpty()) {
-      LoggingUtil.logToRemote(Level.SEVERE, "Not all outputs cleared: " + outputArtifactData,
-          new IllegalStateException());
-    }
-  }
-
-  StackTraceElement[] getInsertionOfMissingArtifactForDebugging(Artifact artifact) {
-    return missingArtifacts.get(artifact);
   }
 
   @Override
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
index 0f75188..ba32dd8 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -68,8 +68,6 @@
 import com.google.protobuf.ByteString;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -491,7 +489,7 @@
     return token;
   }
 
-  void afterExecution(Action action, ActionMetadataHandler metadataHandler, Token token) {
+  void afterExecution(Action action, MetadataHandler metadataHandler, Token token) {
     if (!actionReallyExecuted(action)) {
       // If an action shared with this one executed, then we need not update the action cache, since
       // the other action will do it. Moreover, this action is not aware of metadata acquired
@@ -501,27 +499,11 @@
     try {
       actionCacheChecker.afterExecution(action, token, metadataHandler);
     } catch (IOException e) {
-      List<StackTraceElement[]> stackTraceElements = new ArrayList<>();
-      for (Artifact output : action.getOutputs()) {
-        StackTraceElement[] stackTraceElement =
-            metadataHandler.getInsertionOfMissingArtifactForDebugging(output);
-        if (stackTraceElement != null) {
-          stackTraceElements.add(stackTraceElement);
-        }
-      }
-      String stackTraces = "";
-      if (stackTraceElements.isEmpty()) {
-        stackTraces = "no missing artifacts found?";
-      } else {
-        for (StackTraceElement[] elt : stackTraceElements) {
-          stackTraces += "\n" + Arrays.toString(elt);
-        }
-      }
-      // Skyframe has already done all the filesystem access needed for outputs, and swallows
+      // Skyframe has already done all the filesystem access needed for outputs and swallows
       // IOExceptions for inputs. So an IOException is impossible here.
       throw new IllegalStateException(
           "failed to update action cache for " + action.prettyPrint()
-              + ", but all outputs should already have been checked (" + stackTraces + ")", e);
+              + ", but all outputs should already have been checked", e);
     }
   }