Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B85F9686 for ; Fri, 23 Sep 2011 15:21:05 +0000 (UTC) Received: (qmail 60654 invoked by uid 500); 23 Sep 2011 15:21:04 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 60566 invoked by uid 500); 23 Sep 2011 15:21:04 -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 60555 invoked by uid 99); 23 Sep 2011 15:21:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2011 15:21:04 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rainer.jung@kippdata.de designates 195.227.30.149 as permitted sender) Received: from [195.227.30.149] (HELO mailserver.kippdata.de) (195.227.30.149) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2011 15:20:56 +0000 Received: from [192.168.2.101] ([192.168.2.101]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id p8NFKZl7010105 for ; Fri, 23 Sep 2011 17:20:36 +0200 (CEST) Message-ID: <4E7CA3C3.6050903@kippdata.de> Date: Fri, 23 Sep 2011 17:20:35 +0200 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: dev@tomcat.apache.org Subject: Re: svn commit: r1174468 - /tomcat/jk/trunk/native/common/jk_lb_worker.c References: <20110923004656.325FB23888FE@eris.apache.org> In-Reply-To: X-Enigmail-Version: 1.3.2 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 23.09.2011 16:47, Konstantin Kolinko wrote: > 2011/9/23 : >> Author: rjung >> Date: Fri Sep 23 00:46:55 2011 >> New Revision: 1174468 >> >> URL: http://svn.apache.org/viewvc?rev=1174468&view=rev >> Log: >> When using the alternate decay for the "Next" >> session lb method, calculate curmin only for >> active workers. Otherwise curmin will quickly >> stabilize at "0". >> >> Decay non-active workers as well so that they >> do not report fantasy values. >> >> Modified: >> tomcat/jk/trunk/native/common/jk_lb_worker.c >> >> Modified: tomcat/jk/trunk/native/common/jk_lb_worker.c >> URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_lb_worker.c?rev=1174468&r1=1174467&r2=1174468&view=diff >> ============================================================================== >> --- tomcat/jk/trunk/native/common/jk_lb_worker.c (original) >> +++ tomcat/jk/trunk/native/common/jk_lb_worker.c Fri Sep 23 00:46:55 2011 >> @@ -624,7 +624,7 @@ static jk_uint64_t decay_load(lb_worker_ >> { >> unsigned int i; >> jk_uint64_t curmax = 0; >> - jk_uint64_t curmin; >> + jk_uint64_t curmin = 0; >> lb_sub_worker_t *w; >> ajp_worker_t *aw; >> >> @@ -636,9 +636,6 @@ static jk_uint64_t decay_load(lb_worker_ >> if (p->lbmethod != JK_LB_METHOD_NEXT) { >> w->s->lb_value >>= exponent; >> } >> - if (w->s->lb_value < curmin) { >> - curmin = w->s->lb_value; >> - } > > The initial value of curmin is assigned above the loop: > curmin = (&p->lb_workers[0])->s->lb_value; > > I think you can remove that assignment. It happens without checking > with "JK_WORKER_USABLE()" and thus contradicts with the new code > below. Correct, not removing the line was an oversight. It's gone with r1174830. Regards, Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org