Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 17491 invoked from network); 8 Oct 2007 16:04:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2007 16:04:11 -0000 Received: (qmail 51586 invoked by uid 500); 8 Oct 2007 16:03:55 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 51544 invoked by uid 500); 8 Oct 2007 16:03:55 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 51533 invoked by uid 99); 8 Oct 2007 16:03:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 09:03:55 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [72.22.94.67] (HELO virtual.halosg.com) (72.22.94.67) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 16:03:56 +0000 Received: (qmail 18028 invoked from network); 8 Oct 2007 11:00:52 -0500 Received: from 72-19-171-38.static.mesanetworks.net (HELO ?192.168.3.103?) (72.19.171.38) by halosg.com with SMTP; 8 Oct 2007 11:00:52 -0500 Message-ID: <470A54D5.1030008@hanik.com> Date: Mon, 08 Oct 2007 10:03:33 -0600 From: Filip Hanik - Dev Lists User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: soTimeout not worked on channelNioSocket References: <13091614.post@talk.nabble.com> In-Reply-To: <13091614.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I haven't seen any work done on the NIO part of AJP in a very long time, so what I would suggest you do is 1. submit a bug report at http://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%206 2. If possible, provide a patch Filip William Leung wrote: > I have configuared tomcat to use the NIO impl over AJP, here are the lines in > server.xml > > channelNioSocket.port="8009" > channelNioSocket.soTimeout="600000" > channelNioSocket.bufferSize="16384" > channelNioSocket.maxThreads="125" > channelNioSocket.minSpareThreads="10" > channelNioSocket.maxSpareThreads="50" > > redirectPort="8443" protocol="AJP/1.3" > useBodyEncodingForURI="true" > /> > > (TC version 5.5.17) > I had setted the soTimeout with 10 minutes, cause I notice such stages in > server status > > Stage Time B Sent B Recv Client VHost Request > S 33280840 ms 359 KB 0 KB x.x.x.x 127.0.0.1 GET ... > > That shows several requests were blocking on reading request bodies for > hours. > > But unfortunately it dosen't worked for me, I am expecting a request should > only blocking mostly 10 minutes on read, after that a SocketTimeoutException > should raised. > > After digest the source code of ChannelNioSocket.java, I found that > ChannelNioSocket.SocketInputStream just wait infinitly if no data comes > while socket could not be detected closing > > private void block(int len) throws IOException { > ... ... > if(!dataAvailable) { > blocking = true; > if(log.isDebugEnabled()) > log.debug("Waiting for "+len+" bytes to be available"); > try{ > wait(socketTimeout); > }catch(InterruptedException iex) { > log.debug("Interrupted",iex); > } > blocking = false; > } > if(dataAvailable) { > dataAvailable = false; > if(fill(len) < 0) { > isClosed = true; > } > } > } > > The socketTimeout parameter is not used to throw SocketTimeoutException, > actually it has no meaning. > > I even read the source for TC 6.0.13, the same as above. > > Should it be more precisely that throwing SocketTimeoutException on later > condiction test for (dataAvailable) is not true? > > In ChannelSocket implement, the problem is not exists, it uses blocking > Socket.getInputStream, and it would throws SocketTimeoutException for socket > timeout while Socket.setSoTimeout was called > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org