code: public void processBadResource(int grant, boolean abandonHost) {
      synchronized (lockObject) {
        Set<String> excludedHosts = null;
        TaskInProgress tip = requestToTipMap.get(grant);
        if (!job.canLaunchJobCleanupTask() &&
            (!tip.isRunnable() ||
            (tip.isRunning() &&
                !(speculatedMaps.contains(tip) ||
                    speculatedReduces.contains(tip))))) {
          // The task is not runnable anymore. Job is done/killed/failed or the
          // task has finished and this is a speculative resource
          // Or the task is running and this is a speculative resource
          // but the speculation is no longer needed
          resourceTracker.releaseResource(grant);
          return;
        }
        if (abandonHost) {
          ResourceGrant resource = resourceTracker.getGrant(grant);
          String hostToExlcude = resource.getAddress().getHost();
          taskToContextMap.get(tip).excludedHosts.add(hostToExlcude);
          excludedHosts = taskToContextMap.get(tip).excludedHosts;
        }
        ResourceRequest newReq = resourceTracker.releaseAndRequestResource(grant,
            excludedHosts);
        requestToTipMap.put(newReq.getId(), tip);
        TaskContext context = taskToContextMap.get(tip);
        if (context == null) {
          context = new TaskContext(newReq);
        } else {
          context.resourceRequests.add(newReq);
        }
        taskToContextMap.put(tip, context);
      }
    }
docs: Return this grant and request a different one.
  This can happen because the task has failed, was killed
  or the job tracker decided that the resource is bad
  
  @param grant The grant identifier.
  @param abandonHost - if true then this host will be excluded
  from the list of possibilities for this request