XComp commented on code in PR #25050:
URL: https://github.com/apache/flink/pull/25050#discussion_r1668797608
##########
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, wouldn't it be more consistent to move the shutdown hook initialization
(along with the cleanup scheduling) to the end of the `BlobServer` constructor?
It feels wrong to register the shutdown hook for an instance that's not
fully created, yet. 🤔
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]