Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 57086 invoked from network); 8 Oct 2007 07:10:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2007 07:10:33 -0000 Received: (qmail 28655 invoked by uid 500); 8 Oct 2007 07:10:18 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 28612 invoked by uid 500); 8 Oct 2007 07:10:17 -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 28601 invoked by uid 99); 8 Oct 2007 07:10:17 -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 00:10:17 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 07:10:04 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Iemk3-0004sO-Gl for dev@tomcat.apache.org; Mon, 08 Oct 2007 00:09:27 -0700 Message-ID: <13091614.post@talk.nabble.com> Date: Mon, 8 Oct 2007 00:09:27 -0700 (PDT) From: William Leung To: dev@tomcat.apache.org Subject: soTimeout not worked on channelNioSocket MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: lwr@21cn.com X-Virus-Checked: Checked by ClamAV on apache.org I have configuared tomcat to use the NIO impl over AJP, here are the lines in server.xml (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 -- View this message in context: http://www.nabble.com/soTimeout-not-worked-on-channelNioSocket-tf4586319.html#a13091614 Sent from the Tomcat - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org