Github user serranom commented on the issue: https://github.com/apache/twill/pull/23 I have discovered the cause of the intermittent failure. This code (starting on line 703 of ApplicationMasterService, comments added by me): /* * The provisionRequest will either contain a single container (ALLOCATE_ONE_INSTANCE_AT_A_TIME), or all the * containers to satisfy the expectedContainers count. In the later case, the provision request is complete once * all the containers have run at which point we poll() to remove the provisioning request. */ if (expectedContainers.getExpected(runnableName) == runningContainers.count(runnableName) || provisioning.peek().getType().equals(AllocationSpecification.Type.ALLOCATE_ONE_INSTANCE_AT_A_TIME)) { provisioning.poll(); } There is a case when instances are failing (but not simultaneously) where the retries for the instances will be spread over two invocations of `ApplicationMasterService.handleCompleted`. This means they will be part of separate `RunnableContainerRequests` and thus will be provisioned separately. But because the code above does not anticipate this case, the first provisionRequest will never appear to be satisfied, never be polled and the total can never be met. This is an existing bug, since I think it could happen before my new code -- its just that my test tickles it. If there is agreement, I can file a new JIRA and PR request or just fix it with this PR. Let me know.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---