Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getApplications API call and use it for Yarn app killing #3150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tsangz2013
Copy link
Collaborator

@tsangz2013 tsangz2013 commented Sep 9, 2022

Follow up of #3145

Issue to solve: Upgrade of the yarn application killing logic in normal hadoop job cancel procedure

Changes made: Use yarnClient to get alive YARN application ids & use this method as first choice prior to log-scanning approach

Testing done:

  • Unit tests;
  • Tested in the bare metal exec-server on a spark flow:
  1. uploaded both jar for az-hadoop-jobtype-plugin.jar and azkaban-common.jar to a cluster machine and restarted a exec-server
  2. triggered the sparkFlow execution and kill it after the yarn application is created
  3. verified the job log that it use the yarnClient to get app-ids and kill them

@tsangz2013 tsangz2013 force-pushed the zhzeng/use-get-yarn-library-w-fallback branch from 9aaef0b to ecee390 Compare September 9, 2022 18:46
* @return the set of all to-be-killed (alive) yarn applications' IDs
* @throws IOException for RPC issue
* @throws YarnException for YARN server issue
*/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1: call yarn cluster to get app-report and transform to app-ids

* @param jobProps should contain flow execution id, and the job log file's path
* @param log logger
* @return the set of application ids
*/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2: helper method first call yarnClient, with fallback to scan log

@tsangz2013 tsangz2013 marked this pull request as ready for review September 9, 2022 23:18
* @throws IOException for RPC issue
* @throws YarnException for YARN server issue
*/
public static Set<String> getAllAliveAppIDsByExecID(final YarnClient yarnClient,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would like to return the ApplicationReport from this method and create another method for application id. Since we need to get the user from ApplicationReport as well, if we write it in the current way, we need to have another call to get the user.

@tsangz2013 tsangz2013 force-pushed the zhzeng/use-get-yarn-library-w-fallback branch from ecee390 to 23ca091 Compare September 13, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants