[ 
https://issues.apache.org/jira/browse/YARN-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605415#comment-13605415
 ] 

Sandy Ryza commented on YARN-417:
---------------------------------

bq. Is it related to the exception being thrown when stop() is called on the 
handler thread? Is this guaranteed bad behavior and so we need to throw a 
runtime exception immediately?

It is guaranteed bad behavior - a thread that tries to join with itself will 
wait indefinitely.

bq. I think we need to call client.stop() after the heartbeat thread has 
stopped.

If unregisterApplicationMaster() is called before stop, this is handled by 
setting keepRunning to false there and synchronizing on the AMRMClient in run().

bq. Didnt quite get the assert inside the loop. Perhaps you meant 
takeCompletedContainers()?

It just makes sure that the allocate callback isn't called twice, which I guess 
is a pretty weak assert because there's no good reason that would happen.  I 
can take it out if you think it makes things less clear.

bq. I think updating progress needs to be its own callback since its possible 
that no container allocations and completions happen for a long time and thus 
the heartbeats show no progress to the RM.

When AMRMClientAsync#setProgress is called, the updated progress will be 
transmitted with the next heartbeat.  This can be called whenever something 
occurs that advances the app's progress, not just on callbacks.  Would this not 
work with some ways of using this client that I am not thinking of?
                
> Add a poller that allows the AM to receive notifications when it is assigned 
> containers
> ---------------------------------------------------------------------------------------
>
>                 Key: YARN-417
>                 URL: https://issues.apache.org/jira/browse/YARN-417
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: api, applications
>    Affects Versions: 2.0.3-alpha
>            Reporter: Sandy Ryza
>            Assignee: Sandy Ryza
>         Attachments: AMRMClientAsync-1.java, AMRMClientAsync.java, 
> YARN-417-1.patch, YARN-417-2.patch, YARN-417-3.patch, YARN-417-4.patch, 
> YARN-417-4.patch, YARN-417.patch, YarnAppMaster.java, 
> YarnAppMasterListener.java
>
>
> Writing AMs would be easier for some if they did not have to handle 
> heartbeating to the RM on their own.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to