[ https://issues.apache.org/jira/browse/YARN-107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13720845#comment-13720845 ]
Jason Lowe commented on YARN-107: --------------------------------- bq. I think the easiest way to differentiate the error is based on the exception types it catches. And for the user side, the easiest way is differentiate the error based on the different exist code if we set different exist code for different types of error instead of just simply throwing the exceptions IMHO the most common case for this API is to make sure the application is no longer running, and the caller isn't so much worried about the exact final state as long as it's a terminal state. That means for the common case, users are going to have to wrap calls to this in a try..catch just so they can ignore the corner-case exception. Sounds like a pain. Do we really need to throw an exception in this case? Is the client really going to care and want to field said exception? Same with the CLI, callers would need to check for explicit exit codes to make sure what looks like an error really is an error. If the caller really cares about distinguishing between killing a running app and killing an already terminated app, can't they just check the state first? Regardless of whether they do the check or this API does it for them, there will always be a race where the app completes before it is killed. Maybe I'm in the minority here, and that's fine. I just don't want the API to be difficult to wield in the common case if there's a way for the caller to cover the corner case in another way. > ClientRMService.forceKillApplication() should handle the non-RUNNING > applications properly > ------------------------------------------------------------------------------------------ > > Key: YARN-107 > URL: https://issues.apache.org/jira/browse/YARN-107 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager > Affects Versions: 2.0.0-alpha > Reporter: Devaraj K > Assignee: Xuan Gong > Attachments: YARN-107.1.patch > > -- 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