[ https://issues.apache.org/jira/browse/TWILL-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15954382#comment-15954382 ]
ASF GitHub Bot commented on TWILL-230: -------------------------------------- Github user chtyim commented on a diff in the pull request: https://github.com/apache/twill/pull/53#discussion_r109553180 --- Diff: twill-yarn/src/main/java/org/apache/twill/yarn/YarnTwillController.java --- @@ -322,7 +314,46 @@ private boolean hasRun(YarnApplicationState state) { @Override public ResourceReport getResourceReport() { - // in case the user calls this before starting, return null + // Only has resource report if the app is running. + if (state() != State.RUNNING) { + return null; + } + ResourceReportClient resourcesClient = getResourcesClient(); return (resourcesClient == null) ? null : resourcesClient.get(); } + + /** + * Returns the {@link ResourceReportClient} for fetching resource report from the AM. + * It first consults the RM for the tracking URL and get the resource report from there. + */ + @Nullable + private ResourceReportClient getResourcesClient() { + YarnApplicationReport report = processController.getReport(); + List<URL> urls = new ArrayList<>(2); --- End diff -- Because we store the tracking URL and the original tracking URL. > Retrieval of ResourceReport via TwillController may fail > -------------------------------------------------------- > > Key: TWILL-230 > URL: https://issues.apache.org/jira/browse/TWILL-230 > Project: Apache Twill > Issue Type: Bug > Reporter: Terence Yim > Fix For: 0.11.0 > > > When starting a new {{YarnTwillRunnerService}}, it discovers all existing > applications and get the tracker URL from the application report. However, > the operation might fail if the application was started with a different user > than the one who starts the {{YarnTwillRunnerService}} in a Kerberos cluster, > resulting in failure to get resource report. -- This message was sent by Atlassian JIRA (v6.3.15#6346)