Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41D8D6C83 for ; Tue, 24 May 2011 14:14:05 +0000 (UTC) Received: (qmail 37629 invoked by uid 500); 24 May 2011 14:14:01 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 37601 invoked by uid 500); 24 May 2011 14:14:01 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 37593 invoked by uid 99); 24 May 2011 14:14:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 14:14:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.139.213.126] (HELO nm30-vm0.bullet.mail.bf1.yahoo.com) (98.139.213.126) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 24 May 2011 14:13:51 +0000 Received: from [98.139.212.146] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 24 May 2011 14:13:29 -0000 Received: from [98.139.212.212] by tm3.bullet.mail.bf1.yahoo.com with NNFMP; 24 May 2011 14:13:29 -0000 Received: from [127.0.0.1] by omp1021.mail.bf1.yahoo.com with NNFMP; 24 May 2011 14:13:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 107854.15925.bm@omp1021.mail.bf1.yahoo.com Received: (qmail 54572 invoked by uid 60001); 24 May 2011 14:13:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1306246408; bh=TeDTwWs3zurGzO996KfdsECY3mqptCgEeypY6qJpRek=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=roxqN1NQ8zmiOZyIF4D4xPG6PeH6h7i3Ls5CP7/I9i0pkTwHxDCJEtkReLS08bgKkl+lep0i1IHDxbvk0YY6GYiWa30ePIRfTE1SlEIgziw49/tttQHHOq249wmxR0rkiLhusgAb5X9W3cHxzAM8Ag1JPsyDNNgsJuahi4qCeaQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=UTc0ieYNJXOHzODy+JAUEnv9dcUJR2Us7J/trnmVkaljvuN85xEJDekswxzi2WmkDcKG7O/r2NYw0k+5py/ZaAjU/CR4cNwEuMpu2i16yrN7KO7DD0vwI2jOKC6wRsYZZFUeL2P4VVyhtEp4tZDxrI4cnu0gdaC6R81RF4osUds=; Message-ID: <998143.53164.qm@web161215.mail.bf1.yahoo.com> X-YMail-OSG: 9Gy1xdQVM1mYhZLuvulSPaeGnRDsZFi2nXtviJ99fv5dn0U M8Nr2RuIB2H0hWzQMXSSfpDqfzAxos18i0wi5hZ0XQyWC3XJAgkzpNyvQBLc Oh4hkhIey5LTPLYkU9LQy95B9P88vfydkwl3.3qjVCWzqN_IBe03KEfYlpSr nSm7TYLLJuKxHUXtB__dlvWmncx.SpJPrD7YnMzyL8ppwuTDhENqsv6nuU8E C1k6QSZPFa3Qg6ob5xZesCKn5nGcg3h2xsIR5nvLnZtBbkvF9m82aQ0aodDh H8EWgNtd1WbiZO1oz9Q5q_m.lcbb.L1Qzw7MuxW8MMN4MvhAZ9VdG9PLIIM0 vzKXaidYy4aO4P3JgJQ0lmMcNowx7GBowsv6H77wmYYTyJifTTyCQMGmrtZh BLb7p9ldrZbQOk8_C1PrlMuMPGWI3hLOttEgTo9BMylhqnA2LhXYMfSyO5dJ rPskig_YqSUV99872kKx8_57jTSNyBlt.Ca3PpA-- Received: from [66.207.206.10] by web161215.mail.bf1.yahoo.com via HTTP; Tue, 24 May 2011 07:13:28 PDT X-Mailer: YahooMailWebService/0.8.111.303096 References: Date: Tue, 24 May 2011 07:13:28 -0700 (PDT) From: Keith Mashinter Reply-To: Keith Mashinter To: "users@httpd.apache.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1012899420-1306246408=:53164" X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] ENH 51247 - Enhance mod_proxy and _balancer with worker status flag to only accept sticky session routes --0-1012899420-1306246408=:53164 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =0A=0AI've added a patch to the proxy/balancer to allow for route-only work= ers are only enabled for sticky session routes, allowing for an even more = =0Agraceful fade-out of a server than making its lbfactor=3D1 compared to = =0Albfactor=3D100 for others.=A0 =0A=0A=0APlease vote for it in bugzilla if= you also think it's useful.=0A=0A=0Ahttps://issues.apache.org/bugzilla/sho= w_bug.cgi?id=3D51247=0AThis enhancement, actually SVN Patched against 2.2.1= 9, provides a worker status=0Aflag to set a proxy worker as only accepting = requests with sticky session=0Aroutes, e.g. only accept requests with a .ro= ute such as Cookie=0AJSESSIONID=3Dxxx.tc2.=0A=0AThis allows for a graceful = fade-out of servers when their sessions are removed;=0Athey continue to rec= eive requests for their sticky session routes but are=0Apassed over for req= uests with no specified route, just as if they were=0Adisabled. In other w= ords, route-only workers are only enabled for sticky=0Asession routes.=0A= =0AIntended use (Tomcat JSESSIONID noted here but could be PHPSESSIONID, Ru= by=0A_session_id, or anything with cookie or request-parameter based sessio= n ids):=0A1. An Apache rev-proxy running for multiple Tomcats.=0A2. To fade= -out a Tomcat for maintenance, set route-only enabled in=0Athe=0Abalancer-m= anager or reload the configuration with the worker status +R.=0A(This depen= ds on Tomcat web-apps delete session cookies, see further below.)=0A3. Chec= k on the balancer-manager or its Tomcat worker even a few minutes /=0Ahours= , and when it seems to have completed old sessions you can mark it fully=0A= disabled.=0A4. Once done maintenance, you can then set route-only disabled = (status -R) and=0Afully enable the worker again.=0A=0ATo delete a JSESSIONI= D Cookie from a Servlet, you need to specify the same=0ADomain and Path as = the original Cookie and setMaxAge=3D0 as in the typical=0Aexample below but= you should check on your own Domain and Path when a Cookie is=0Acreated, e= .g. watch the Cookie headers in Firefox Firebug.=0A=0A// To delete a Cookie= setMaxAge(0) and also any original domain and path if=0Aspecified.=0ACooki= e ck =3D new Cookie("JSESSIONID", null);=0A//ck.setDomain("");=0Ack.setPath= (request.getContextPath());=0Ack.setMaxAge(0);=0Aresponse.addCookie(ck);=0A= =A0=0A\|/- Keith Mashinter =0Akmashint@yahoo.com --0-1012899420-1306246408=:53164 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable

I've=0A added a patch to the proxy/balancer to allow for route= -only workers are=0A only enabled for sticky session routes, allowing for a= n even more =0Agraceful fade-out of a server than making its lbfactor=3D1 c= ompared to =0Albfactor=3D100 for others. 

<= /div>
Please vote for it in bugzilla if you also think it's useful.
=

https://issues.apache.org/bugzilla/sh= ow_bug.cgi?id=3D51247
This enhancement, actually SVN Patched =
against 2.2.19, provides a worker status
flag to set a proxy worker as o= nly accepting requests with sticky session
routes, e.g. only accept requ= ests with a .route such as Cookie
JSESSIONID=3Dxxx.tc2.

This allo= ws for a graceful fade-out of servers when their sessions are removed;
they continue to receive requests for = their sticky session routes but are
passed over for requests with no spe= cified route, just as if they were
disabled. In other words, route-only= workers are only enabled for sticky
session routes.

Intended use= (Tomcat JSESSIONID noted here but could be PHPSESSIONID, Ruby
_session_= id, or anything with cookie or request-parameter based session ids):
1. = An Apache rev-proxy running for multiple Tomcats.
2. To fade-out a Tomca= t for maintenance, set route-only enabled in
the
balancer-manager or= reload the configuration with the worker status +R.
(This depends on To= mcat web-apps delete session cookies, see further below.)
3. Check on th= e balancer-manager or its Tomcat worker even a few minutes /
hours, and = when it seems to have completed old sessions you can mark it fully
disab= led.
4. Once done maintenance, you can then set route-only disabled (status -R) and
fully enable the worker again.

To delet= e a JSESSIONID Cookie from a Servlet, you need to specify the same
Domai= n and Path as the original Cookie and setMaxAge=3D0 as in the typical
ex= ample below but you should check on your own Domain and Path when a Cookie = is
created, e.g. watch the Cookie headers in Firefox Firebug.
=
// To delete a Cookie setMaxAge(0) and also any origi= nal domain and path if
specified.
Cookie ck =3D new Cookie("JSESS= IONID", null);
//ck.setDomain("");
ck.setPath(request.getCont= extPath());
ck.setMaxAge(0);
response.addCookie(ck);
 <= /span>
\|/- Keith Mashinter
kmashint@yahoo.com
--0-1012899420-1306246408=:53164--