[ https://issues.apache.org/jira/browse/TWILL-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15844189#comment-15844189 ]
ASF GitHub Bot commented on TWILL-181: -------------------------------------- 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. > Control the maximum number of retries for failed application starts > ------------------------------------------------------------------- > > Key: TWILL-181 > URL: https://issues.apache.org/jira/browse/TWILL-181 > Project: Apache Twill > Issue Type: Improvement > Components: yarn > Affects Versions: 0.7.0-incubating > Reporter: Martin Serrano > Assignee: Martin Serrano > Fix For: 0.10.0 > > > If an application consistently exits with a non-zero code, twill will > attempt to restart indefinitely. I ran into this issue and a list search > also reveals [others| http://markmail.org/message/dehx7r6tpqgcmjh4]. > There should be a mechanism to specify the maximum number of retries until > the application fails. Ideally by default there would be a non-infinite > maximum. -- This message was sent by Atlassian JIRA (v6.3.4#6332)