rkhachatryan commented on code in PR #25050: URL: https://github.com/apache/flink/pull/25050#discussion_r1668850192
########## flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServer.java: ########## @@ -354,10 +354,12 @@ public void close() throws IOException { if (shutdownRequested.compareAndSet(false, true)) { Exception exception = null; - try { - this.serverSocket.close(); - } catch (IOException ioe) { - exception = ioe; + if (serverSocket != null) { // can be null if shut down before constructor completion Review Comment: The following comment in the constructor made me think that this is intentional - the hook is registered before starting anything that might potentially fail, so the resource cleanup is guaranteed. ``` ... this.cleanupTimer.schedule( ... this.shutdownHook = ShutdownHookUtil.addShutdownHook(this, getClass().getSimpleName(), LOG); // ----------------------- start the server ------------------- ... this.serverSocket = NetUtils.createSocketFromPorts( ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org