XComp commented on code in PR #25050: URL: https://github.com/apache/flink/pull/25050#discussion_r1668880762
########## 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: we would need another `null` check in further down in the `closeAsync` method (where the log message is created). ########## 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: hm, I guess, you're right. The socket creation should live in the `BlobServer#start` method. ...from a conceptual standpoint. Shall we make the `serverSocket` field `@Nullable` as part of this change to underline this? -- 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