flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject flink git commit: [hotfix] [webserver] Add sanity check to avoid NPE in case the web server could not be instantiated
Date Wed, 20 Jan 2016 17:01:55 GMT
Repository: flink
Updated Branches:
  refs/heads/master ac42d1504 -> 83fb2fa89


[hotfix] [webserver] Add sanity check to avoid NPE in case the web server could not be instantiated

The method WebMonitorUtils.startWebRuntimeMonitor instantiates the WebMonitor. However, in
case of a failure null is returned. This failure case has to be handled in the method FlinkMiniCluster.startWebServer
in order to avoid a possible NullPointerException.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/83fb2fa8
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/83fb2fa8
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/83fb2fa8

Branch: refs/heads/master
Commit: 83fb2fa8907596da263327fc063b1271e49395ec
Parents: ac42d15
Author: Till Rohrmann <trohrmann@apache.org>
Authored: Wed Jan 20 17:59:33 2016 +0100
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Wed Jan 20 17:59:33 2016 +0100

----------------------------------------------------------------------
 .../flink/runtime/minicluster/FlinkMiniCluster.scala    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/83fb2fa8/flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
b/flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
index 660c813..bdb62ba 100644
--- a/flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
+++ b/flink-runtime/src/main/scala/org/apache/flink/runtime/minicluster/FlinkMiniCluster.scala
@@ -282,12 +282,16 @@ abstract class FlinkMiniCluster(
       LOG.info("Starting JobManger web frontend")
       // start the new web frontend. we need to load this dynamically
       // because it is not in the same project/dependencies
-      val webServer = WebMonitorUtils.startWebRuntimeMonitor(
-        config, leaderRetrievalService, actorSystem)
+      val webServer = Option(
+        WebMonitorUtils.startWebRuntimeMonitor(
+          config,
+          leaderRetrievalService,
+          actorSystem)
+      )
 
-      webServer.start(jobManagerAkkaURL)
+      webServer.foreach(_.start(jobManagerAkkaURL))
 
-      Option(webServer)
+      webServer
     } else {
       None
     }


Mime
View raw message