[ 
https://issues.apache.org/jira/browse/THRIFT-5411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17351756#comment-17351756
 ] 

Yuxuan Wang edited comment on THRIFT-5411 at 5/26/21, 3:32 PM:
---------------------------------------------------------------

do your clients use connection pool? if they use client pools (put the 
connection back into the pool after finished requests, rather than close the 
connections) this is usually normal because idle client connections will cause 
the server to have socket read timeouts. the solution to that is to either 
don't set socket read time out on the server, or set the socket read timeout 
longer than your client's pool ttl settings.


was (Author: fishywang):
do you clients use client pool? if they use client pools (put the connection 
back into the pool after finished requests, rather than close the connections) 
this is usually normal because idle client connections will cause the server to 
have socket read timeouts. the solution to that is to either don't set socket 
read time out on the server, or set the socket read timeout longer than your 
client's pool ttl settings.

>  Catch SocketTimeoutException in TIOStreamTransport read
> --------------------------------------------------------
>
>                 Key: THRIFT-5411
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5411
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.14.1
>            Reporter: Isha
>            Assignee: David Mollitor
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi,
> There is an issue in thrift library.
> From thrift version 0.12.0, we see some unwanted logs in our application logs 
> as below:
> 1620367702942[20210507 11:38:22] [TThreadPoolServer$WorkerProcess::run] May 
> 07, 2021 11:38:22 AM org.apache.thrift.server.TThreadPoolServer$WorkerProcess 
> run
> SEVERE: Thrift Error occurred during processing of message.
> org.apache.thrift.transport.TTransportException: 
> java.net.SocketTimeoutException: Read timed out
>  at 
> org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:178)
>  at org.apache.thrift.transport.TTransport.readAll(TTransport.java:109)
>  at 
> org.apache.thrift.transport.layered.TFramedTransport.readFrame(TFramedTransport.java:138)
>  at 
> org.apache.thrift.transport.layered.TFramedTransport.read(TFramedTransport.java:106)
>  at org.apache.thrift.transport.TTransport.readAll(TTransport.java:109)
>  at 
> org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:463)
>  at 
> org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:361)
>  at 
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:244)
>  at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27)
>  at 
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:248)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
> Caused by: java.net.SocketTimeoutException: Read timed out
>  at java.net.SocketInputStream.socketRead0(Native Method)
>  at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
>  at java.net.SocketInputStream.read(SocketInputStream.java:171)
>  at java.net.SocketInputStream.read(SocketInputStream.java:141)
>  at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
>  at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
>  at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
>  at 
> org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:176)
>  ... 12 more
> org.apache.thrift.transport.TTransportException: 
> java.net.SocketTimeoutException: Read timed out
>  at 
> org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:178)
>  at org.apache.thrift.transport.TTransport.readAll(TTransport.java:109)
>  at 
> org.apache.thrift.transport.layered.TFramedTransport.readFrame(TFramedTransport.java:138)
>  at 
> org.apache.thrift.transport.layered.TFramedTransport.read(TFramedTransport.java:106)
>  at org.apache.thrift.transport.TTransport.readAll(TTransport.java:109)
>  at 
> org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:463)
>  at 
> org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:361)
>  at 
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:244)
>  at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27)
>  at 
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:248)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
> Caused by: java.net.SocketTimeoutException: Read timed out
>  at java.net.SocketInputStream.socketRead0(Native Method)
>  at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
>  at java.net.SocketInputStream.read(SocketInputStream.java:171)
>  at java.net.SocketInputStream.read(SocketInputStream.java:141)
>  at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
>  at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
>  at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
>  at 
> org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:176)
>  ... 12 more
>  
> The exception is printed from TTheadPoolServer.java class as a non ignorable 
> exception. But as per our analysis, the above exception is not creating any 
> impact to us. And, it gets printed so many time in our application logs, 
> which causes confusion to users.
> We have no control to avoid printing of this exception in our application.
> Please let me know if thrift can ignore this exception so that it will not be 
> printed.
> If possible, please share the thrift version also, so that we can plan 
> accordingly.
> Let me know if any further information is required.
> Best Regards
> Isha
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to