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

Dan Berindei dan.berindei at gmail.com
Fri Jun 5 12:01:07 EDT 2015


I would start with dtrace, to see the actual error code returned by
the socket() system call.

Dan


On Fri, Jun 5, 2015 at 6:46 PM, Galder Zamarreño <galder at redhat.com> wrote:
> 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
>
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev



More information about the infinispan-dev mailing list