[ https://issues.apache.org/jira/browse/FLINK-9231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16448079#comment-16448079 ]
Triones Deng commented on FLINK-9231: ------------------------------------- [~yuzhih...@gmail.com] I notice that there are two kind of server socket, # make use of SockerServer, like JobManager,TaskManager, TaskManagerRunner and BlobServer, all of them create socket server by NetUtils.createSocketFromPorts # make use of Netty for io,like NettyServer. I think if we plan to make use of SO_REUSEADDR, "which is suitable It is useful if your server has been shut down, and then restarted right away while sockets are still active on its port. You should be aware that if any unexpected data comes in, it may confuse your server, but while this is possible, it is not likely" (see :[https://stackoverflow.com/questions/19960475/problems-related-to-so-reuseaddr?rq=1)] , Here may be we can allow sockets to set SO_REUSEADDR when start JobManager,TaskManager, TaskManagerRunner. anything wrong please correct me. sample code for JobManager.scala like: {code:java} val socket = NetUtils.createSocketFromPorts( listeningPortRange, new NetUtils.SocketFactory { override def createSocket(port: Int): ServerSocket = { // Use the correct listening address, bound ports will only be // detected later by Akka. val serverSocket = new ServerSocket() serverSocket.setReuseAddress(true) serverSocket.bind(new InetSocketAddress(InetAddress.getByName(NetUtils.getWildcardIPAddress), port), 0) serverSocket } }) {code} > Enable SO_REUSEADDR on listen sockets > ------------------------------------- > > Key: FLINK-9231 > URL: https://issues.apache.org/jira/browse/FLINK-9231 > Project: Flink > Issue Type: Improvement > Reporter: Ted Yu > Assignee: Triones Deng > Priority: Major > > This allows sockets to be bound even if there are sockets > from a previous application that are still pending closure. -- This message was sent by Atlassian JIRA (v7.6.3#76005)