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

[FLINK-5488] stop YarnClient before exception is thrown #4022

Closed
wants to merge 3 commits into from

Conversation

FangYongs
Copy link
Contributor

Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the How To Contribute guide.
In addition to going through the list, please provide a meaningful description of your changes.

  • General

    • The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message (including the JIRA id)
  • Documentation

    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build

    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

@@ -392,6 +392,7 @@ protected YarnClient getYarnClient() {
@Override
public YarnClusterClient retrieve(String applicationID) {

final YarnClient yarnClient = getYarnClient();
try {
// check if required Hadoop environment variables are set. If not, warn user
if (System.getenv("HADOOP_CONF_DIR") == null &&
Copy link
Contributor

Choose a reason for hiding this comment

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

does getYarnClient() fail if this condition is fulfilled? If so we should put this if block before the call to getYarnClient().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a good point, I will put getYarnClient() in the try block

@@ -420,6 +421,9 @@ public YarnClusterClient retrieve(String applicationID) {

return createYarnClusterClient(this, yarnClient, appReport, flinkConfiguration, false);
} catch (Exception e) {
if(null != yarnClient) {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing space after if.

@@ -146,7 +146,9 @@ public ApplicationStatus getApplicationStatus() {

@Override
public void finalizeCluster() {
// Do nothing
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert the changes here. This file is part of another big initiative (referred to as FLIP-6); we shouldn't touch it unless necessary. (basically, I don't know about the yarn-client life-cycle here so let's be conservative.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have reverted the changes and fixed another problem as Ted Yu metioned in FLINK-5488, thanks @zentol

@zentol
Copy link
Contributor

zentol commented Jun 26, 2017

merging.

zentol pushed a commit to zentol/flink that referenced this pull request Jun 26, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 27, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 27, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 28, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 28, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 28, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 29, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Jun 30, 2017
@asfgit asfgit closed this in 3d2f3f6 Jul 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants