[infinispan-dev] Mysterious "java.net.SocketException: Socket closed"

Galder Zamarreño galder at redhat.com
Fri Jun 5 11:46:36 EDT 2015


Hi all,

Re: https://issues.jboss.org/browse/ISPN-5506

I'm encountering an odd issue with the Apache Http Commons client when talking to a Netty-based RESTEasy server. I'm randomly getting "java.net.SocketException: Socket closed" when constructing a brand new Socket to talk to the server 1/2ms after starting the process of connecting a new socket [1]. This is happening with both client and server in my MBP, and running our testsuite which uses localhost addresses. The log attached shows log for both the server and client which run on same JVM.

Any ideas could be causing it? If the server was not up, the exception would be different, like connection refused or something like that. I've seen "Socket closed" before but that normally means that a Socket that's been closed is being reused, but that doesn't seem to be the case here since DefaultProtocolSocketFactory always creates a brand new Socket.

I was wondering about using Byteman to trace so particular calls to JDK methods maybe?

Also, this only seems to happen in my OSX env. In our CI env, it seems to run fine all the time.

Cheers,
--
Galder Zamarreño
galder at redhat.com







More information about the infinispan-dev mailing list