# Java.io.IOException: Connection timed out error

**URL:** <https://discuss.elastic.co/t/java-io-ioexception-connection-timed-out-error/22671>\
**Category:** Elasticsearch\
**Created:** [March 15, 2015, 3:56pm UTC](https://discuss.elastic.co/t/java-io-ioexception-connection-timed-out-error/22671 "2015-03-15T15:56:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunil](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Sunil](https://discuss.elastic.co/u/Sunil)\
**Post date:** [March 15, 2015, 3:56pm UTC](https://discuss.elastic.co/t/java-io-ioexception-connection-timed-out-error/22671/1 "2015-03-15T15:56:42Z")

</div>

Hi,

We are using ElasticSearch 1.1.0 server. I have a Java Web Application that connects to ElasticSearch using Transport Client. When the application starts it is able to connect to elasticsearch server and all the searches work but after every couple of hours(This happens randomly) the application stops working/not able to execute search on elasticsearch. When i enable client transport and netty transport trace i see following exception.

[2015-Mar-14 18:37:56:647] TRACE [Gertrude Yorkes] close connection exception caught on transport layer [[id: 0x08525d42, /172.26.129.121:51561 =\> [p01sml002.aap.csaa.com/172.29.24.69:9300](http://p01sml002.aap.csaa.com/172.29.24.69:9300)]], disconnecting from relevant node  
java.io.IOException: Connection timed out  
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)  
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)  
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)  
at sun.nio.ch.IOUtil.read(IOUtil.java:192)  
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)  
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:745)  
[2015-Mar-14 18:37:56:647] TRACE [Gertrude Yorkes] close connection exception caught on transport layer [[id: 0x08525d42, /172.26.129.121:51561 =\> [p01sml002.aap.csaa.com/172.29.24.69:9300](http://p01sml002.aap.csaa.com/172.29.24.69:9300)]], disconnecting from relevant node  
java.io.IOException: Connection timed out  
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)  
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)  
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)  
at sun.nio.ch.IOUtil.read(IOUtil.java:192)  
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)  
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:745)

---

<div class="post-metadata">

**Author:** ![andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@andrew](https://discuss.elastic.co/u/andrew)\
**Post date:** [March 16, 2015, 4:20pm UTC](https://discuss.elastic.co/t/java-io-ioexception-connection-timed-out-error/22671/2 "2015-03-16T16:20:36Z")

</div>

What does the load look like on [p01sml002.aap.csaa.com/172.29.24.69:9300](http://p01sml002.aap.csaa.com/172.29.24.69:9300)? [http://p01sml002.aap.csaa.com/172.29.24.69:9300?](http://p01sml002.aap.csaa.com/172.29.24.69:9300?)

If the client is timing out, it’s likely because the other end of the connection is too busy to respond.

- Andrew

> On Mar 15, 2015, at 8:56 AM, Sunil [pppsunil@gmail.com](mailto:pppsunil@gmail.com) wrote:
> 
> Hi,
> 
> We are using Elasticsearch 1.1.0 server. I have a Java Web Application that  
> connects to Elasticsearch using Transport Client. When the application  
> starts it is able to connect to elasticsearch server and all the searches  
> work but after every couple of hours(This happens randomly) the application  
> stops working/not able to execute search on elasticsearch. When i enable  
> client transport and netty transport trace i see following exception.
> 
> [2015-Mar-14 18:37:56:647] TRACE [Gertrude Yorkes] close connection  
> exception caught on transport layer [[id: 0x08525d42, /172.26.129.121:51561  
> =\> [p01sml002.aap.csaa.com/172.29.24.69:9300](http://p01sml002.aap.csaa.com/172.29.24.69:9300)]], disconnecting from relevant  
> node  
> java.io.IOException: Connection timed out  
> at sun.nio.ch.FileDispatcherImpl.read0(Native Method)  
> at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)  
> at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)  
> at sun.nio.ch.IOUtil.read(IOUtil.java:192)  
> at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
> at  
> org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> at  
> org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:745)  
> [2015-Mar-14 18:37:56:647] TRACE [Gertrude Yorkes] close connection  
> exception caught on transport layer [[id: 0x08525d42, /172.26.129.121:51561  
> =\> [p01sml002.aap.csaa.com/172.29.24.69:9300](http://p01sml002.aap.csaa.com/172.29.24.69:9300)]], disconnecting from relevant  
> node  
> java.io.IOException: Connection timed out  
> at sun.nio.ch.FileDispatcherImpl.read0(Native Method)  
> at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)  
> at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)  
> at sun.nio.ch.IOUtil.read(IOUtil.java:192)  
> at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
> at  
> org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> at  
> org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:745)
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/java-io-IOException-Connection-timed-out-error-tp4072010.html](http://elasticsearch-users.115913.n3.nabble.com/java-io-IOException-Connection-timed-out-error-tp4072010.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1426435002348-4072010.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1426435002348-4072010.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/D24A3567-432F-40AA-BFCA-64814E72F6CD%40elastic.co](https://groups.google.com/d/msgid/elasticsearch/D24A3567-432F-40AA-BFCA-64814E72F6CD%40elastic.co).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:26am UTC](https://discuss.elastic.co/t/java-io-ioexception-connection-timed-out-error/22671/3 "2017-07-06T00:26:31Z")

</div>


