You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by uc...@apache.org on 2017/02/15 10:31:51 UTC

[2/2] flink git commit: [FLINK-5745] [network] Set uncaught exception handler for Netty threads

[FLINK-5745] [network] Set uncaught exception handler for Netty threads

This sets a JVM-terminating handler that logs errors from uncaught exceptions
and terminates the process so that critical exceptions are not accidentally
lost and leave the system running in an inconsistent state.

This closes #3293.


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

Branch: refs/heads/master
Commit: 9b4cd349fbe54c05670a184472f65dabd0558b81
Parents: b455f22
Author: Nico Kruber <ni...@data-artisans.com>
Authored: Fri Feb 10 12:04:37 2017 +0100
Committer: Ufuk Celebi <uc...@apache.org>
Committed: Wed Feb 15 11:26:33 2017 +0100

----------------------------------------------------------------------
 .../org/apache/flink/runtime/io/network/netty/NettyServer.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/9b4cd349/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
index 490b53e..55d2b18 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
@@ -30,6 +30,7 @@ import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.handler.ssl.SslHandler;
+import org.apache.flink.runtime.util.FatalExitExceptionHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,7 +45,10 @@ import static org.apache.flink.util.Preconditions.checkState;
 
 class NettyServer {
 
-	private static final ThreadFactoryBuilder THREAD_FACTORY_BUILDER = new ThreadFactoryBuilder().setDaemon(true);
+	private static final ThreadFactoryBuilder THREAD_FACTORY_BUILDER =
+		new ThreadFactoryBuilder()
+			.setDaemon(true)
+			.setUncaughtExceptionHandler(FatalExitExceptionHandler.INSTANCE);
 
 	private static final Logger LOG = LoggerFactory.getLogger(NettyServer.class);