mojira.dev
MC-2670

Java SocketException on shutdown

Every time I issue the "stop" command, this happens:

java.net.SocketException: Socket closed
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
        at java.net.ServerSocket.implAccept(ServerSocket.java:522)
        at java.net.ServerSocket.accept(ServerSocket.java:490)
        at hu.run(SourceFile:66)

This happens every time I stop the server, I only run bleeding edge builds on this server, but it is annoying that they don't make clean exits. Additionally, either it isn't working or doesn't exist, but sigint quits java, not minecraft, which makes writing a good init.d script nigh impossible.

Related issues

Comments

Selbram (Tory Clement)

Do you get the same error with Oracle Java? Better question, Would you be willing to test Oracle Java to see if it gives the same error? 🙂

kumasasa

This message is just telling you "Socket closed" nothing else. There is no error, this is normal.

Gravious

It is a SocketException, therefore it is thrown inside of a 'try'-loop, most definitely something that is not intended to be there.

Also, perhaps the title should be changed to "Java SocketException on shutdown", as I wasn't able to find it by searching for those keywords.

Michael Aldridge

it is intended to throw errors on shutdown? In my experience, good code doesn't do that! I can look into it with oracle java, but seeing as that is EOL for my platform, I was trying to migrate away from it.

Lei Zhao

Agree with Michael. How could this be intended?? You should catch the exception and give a better message.

kumasasa

Ok, reopened.

xPaw

This is still happening on latest snapshot.

[14:34:09] [Server Listen Thread/ERROR]: Exception handling pending connection
java.net.SocketException: Socket closed
        at java.net.PlainSocketImpl.socketAccept(Native Method) ~[?:1.7.0_25]
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398) ~[?:1.7.0_25]
        at java.net.ServerSocket.implAccept(ServerSocket.java:530) ~[?:1.7.0_25]
        at java.net.ServerSocket.accept(ServerSocket.java:498) ~[?:1.7.0_25]
        at jt.run(SourceFile:66) [minecraft_server.jar:?]
Talven81

Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 ? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Lei Zhao

Talven81, my 1.7.2 server is not throwing exceptions on shutdown anymore.

Christie N

An error like this is still present in 1.7.4, but inconsistent. (sometimes it shows, sometimes not)

Michael Aldridge

(Unassigned)

Unconfirmed

Minecraft 1.4.4, Minecraft 1.6.2, Minecraft 13w39b, Minecraft 1.7.4

Minecraft 1.7.4

Retrieved