public void handleContainerLaunchFail(String containerID, String resourceID,
      ContainerAllocator containerAllocator) {

    if (StandbyTaskUtil.isStandbyContainer(containerID)) {
      log.info("Handling launch fail for standby-container {}, requesting resource on any host {}", containerID);
      String activeContainerHost = getActiveContainerHost(containerID)
              .orElse(null);
      requestResource(containerAllocator, containerID, ResourceRequestState.ANY_HOST, Duration.ZERO, activeContainerHost);
    } else {
      initiateStandbyAwareAllocation(containerID, resourceID, containerAllocator);
    }
  }
Handle the failed launch of a container, based on
   Case 1. If it is an active container, then initiate a failover for it.
   Case 2. If it is standby container, request a new resource on AnyHost.
@param containerID the ID of the container that has failed
samza-core/src/main/java/org/apache/samza/clustermanager/StandbyContainerManager.java