Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 30845 invoked from network); 18 May 2009 22:10:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 May 2009 22:10:55 -0000 Received: (qmail 24012 invoked by uid 500); 18 May 2009 22:10:54 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 23940 invoked by uid 500); 18 May 2009 22:10:54 -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 23929 invoked by uid 99); 18 May 2009 22:10:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 22:10:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 22:10:52 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id D8F2129A0012; Mon, 18 May 2009 15:10:31 -0700 (PDT) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 46985] Impossible condition in coyote.http11.Http11Processor.process(Socket socket) X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 6 X-Bugzilla-Component: Catalina X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: knst.kolinko@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: default X-Bugzilla-Changed-Fields: In-Reply-To: References: Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Message-Id: <20090518221031.D8F2129A0012@brutus.apache.org> Date: Mon, 18 May 2009 15:10:31 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=46985 --- Comment #2 from Konstantin Kolinko 2009-05-18 15:10:29 PST --- For reference: Mark's fix in trunk is r763262 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=763262 ) (In reply to comment #0) > coyote.http11.Http11Processor.process(Socket socket) > ... > > int soTimeout = socket.getSoTimeout(); > int oldSoTimeout = soTimeout; > > int threadRatio = (endpoint.getCurrentThreadsBusy() * 100) > / endpoint.getMaxThreads(); > if (threadRatio > 75) { > keepAliveLeft = 1; > } > > if (soTimeout != oldSoTimeout) { > > The above condition will never be true. It looks like the code is trying to > reset the timeout if it has not changed, but it will never do so. > That "if (soTimeout != oldSoTimeout) { .. }" works in TC 5.5, because of some block of code that precedes it, but is dead in TC 6.0 because that preceding block is removed. You can look at TC 5.5 sources, but as I was studying it through svn log, I will give a reference to annotated source of it at revision 398045 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=398045 ): http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java?annotate=398045&limit_changes=0&pathrev=423920 The code was the following: 751 : int soTimeout = socket.getSoTimeout(); 752 : int oldSoTimeout = soTimeout; 753 : 754 : remm 396579 int threadRatio = (endpoint.getCurrentThreadsBusy() * 100) 755 : remm 389146 / endpoint.getMaxThreads(); 756 : if ((threadRatio > 33) && (threadRatio <= 66)) { 757 : soTimeout = soTimeout / 2; 758 : } else if ((threadRatio > 66) && (threadRatio <= 90)) { 759 : soTimeout = soTimeout / 3; 760 : keepAliveLeft = 1; 761 : } else if (threadRatio > 90) { 762 : soTimeout = soTimeout / 20; 763 : keepAliveLeft = 1; 764 : } 765 : 766 : if (soTimeout != oldSoTimeout) { I will propose removal of the dead code in TC 6.0. > Both the method and the class have a variable called "socket" which may be part > of the problem - is the method trying to set the instance socket to have the > same timeout as the parameter socket, or vice versa? > > The socket parameter should be renamed. > No error there, no need to rename. Both are pointing to the same object. Also, you may note, that this.socket is set back to null at the end of the method. > Note that the Javadoc appears to be completely wrong as well. Oh, it says about input and output streams. Those are provided by the socket. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org