[infinispan-issues] [JBoss JIRA] (ISPN-5221) Java Hotrod client, nearcache broken after a org.infinispan.client.hotrod.exceptions.TransportException:: java.net.SocketTimeoutException

Enrico Olivelli (JIRA) issues at jboss.org
Thu Mar 12 10:47:18 EDT 2015


    [ https://issues.jboss.org/browse/ISPN-5221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049438#comment-13049438 ] 

Enrico Olivelli commented on ISPN-5221:
---------------------------------------

I checked out your code
IMHO I cannot understand how the client recovers from the readtimeout scenario or even the socket closed scenario, could you please explain ?

This is the scenario:
- I have two hotrod servers
- my client at startup connects to one server
- the connection due to OS or network problems gets closed
- the ClientSideNotifier dies and stops to forward to Listeners

I cannot find where the connection gets invalidated (and the server maybe added to the failed servers list) and a new connection is created

Another question:
in case of a socketreadtimeout is it possible that the "unread bytes" will be read from the next call to readEvent ? resulting in a corrupted stream  (?InvalidResponseException and readMagic ?)

thank you very much

> Java Hotrod client, nearcache broken after a org.infinispan.client.hotrod.exceptions.TransportException:: java.net.SocketTimeoutException
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISPN-5221
>                 URL: https://issues.jboss.org/browse/ISPN-5221
>             Project: Infinispan
>          Issue Type: Bug
>    Affects Versions: 7.1.0.Final
>         Environment: Infinispan 7.1.0Final
>            Reporter: Enrico Olivelli
>            Assignee: Galder Zamarreño
>             Fix For: 7.2.0.Final
>
>
> Using the LAZY nearcache (new in 7.1.0Final) when a java.net.SocketTimeoutException occurs against one of the given HotRod server the RemoteCache becames not usable any more
> This happens very frequently in our DEV environment, but I cannot reproduce it inside a test case
> This is the stacktrace
> {code}
>  15/02/13 14:51:39 ERROR event.ClientListenerNotifier: ISPN004043: Unrecoverable error reading event from server xxx.xxx.xxx/10.168.10.117:11222, exiting event reader thread
> org.infinispan.client.hotrod.exceptions.TransportException:: java.net.SocketTimeoutException
>       at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.readByte(TcpTransport.java:184)
>       at org.infinispan.client.hotrod.impl.protocol.Codec20.readMagic(Codec20.java:282)
>       at org.infinispan.client.hotrod.impl.protocol.Codec20.readEvent(Codec20.java:126)
>       at org.infinispan.client.hotrod.event.ClientListenerNotifier$EventDispatcher.run(ClientListenerNotifier.java:236)
>       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: java.net.SocketTimeoutException
>       at sun.nio.ch.SocketAdaptor$SocketInputStream.read(SocketAdaptor.java:211)
>       at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
>       at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
>       at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
>       at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.readByte(TcpTransport.java:179)
>       ... 8 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)



More information about the infinispan-issues mailing list