[
https://issues.apache.org/jira/browse/FLINK-3434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15159017#comment-15159017
]
ASF GitHub Bot commented on FLINK-3434:
---------------------------------------
GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/1695
[FLINK-3434] Prevent NPE in ClieFrotend#getClient()
CliFrontend#getClient() can enocunter a NullPointerException when executing
```
yarnCluster = flinkYarnClient.deploy();
yarnCluster.connectToCluster();
```
since the deploy call can return null if
```org.apache.flink.core.fs.FileSystem.setDefaultScheme(flinkConfiguration)```
throws an IOException .
This NPE would be catched and wrapped in a new IOException. By rethrowing
the original IOException directly instead of returning null the whole affair is
a bit more straight forward, and removes an unnecessary exception form the
stack trace.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 3434_yarn_deploy
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1695.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1695
----
commit 3b2e36ae466f7f8c6afc3dfd0fd85a519f04a83a
Author: zentol <[email protected]>
Date: 2016-02-18T12:35:39Z
[FLINK-3434] Prevent NPE in ClieFrotend#getClient()
----
> Return value from flinkYarnClient#deploy() should be checked against null
> -------------------------------------------------------------------------
>
> Key: FLINK-3434
> URL: https://issues.apache.org/jira/browse/FLINK-3434
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Chesnay Schepler
> Priority: Minor
>
> In CliFrontend#getClient() :
> {code}
> yarnCluster = flinkYarnClient.deploy();
> yarnCluster.connectToCluster();
> {code}
> Looking at FlinkYarnClientBase#deployInternal(), null return is possible:
> {code}
> try {
>
> org.apache.flink.core.fs.FileSystem.setDefaultScheme(flinkConfiguration);
> } catch (IOException e) {
> LOG.error("Error while setting the default " +
> "filesystem scheme from configuration.", e);
> return null;
> }
> {code}
> We should check the return from deploy() before calling connectToCluster().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)