-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Martin,

On 3/22/18 6:58 AM, Martin Knoblauch wrote:
> we have this annoying problem that although Tomcat workers are set
> to DIS state in mod_jk, there are new connections being opened.
> This prevents us from "idle down" Tomcats in a timely fashion. This
> hurts when a restart is needed. While our empathy for human clients
> is pretty limited, we care a lot about our automated workloads :-)
> 
> Our setup: Apache 2.4.x frontend -> mod_jk(1.2.42) balancer,
> sticky sessions -> a bunch of Tomcat 7 (yes I know. Oldie but
> Goldie :-) workers.
> 
> As far as I understand, the problem arises with HTTP(S) clients
> that cache the session cookies. If such a client tries to open a
> new connection to the backend, the old cookie passes to a DIS
> worker even if it is no longer valid on the Tomcat side.
> Tomcat/Application then sees that the cookie is not valid and doles
> out a new cookie which then allows the new connection to be
> established.
> 
> My idea is now to delete existing session cookies for certain
> request pattern on the Apache frontend. If it works, it should
> force mod_jk to a new ACT Tomcat. But I am nor really fond of
> messing with the Apache configuration, as the reason lies on the
> mod_jk/Tomcat side.
> 
> So if anybody has another suggestion I would love to hear it.
> Before I forget, changing the application itself is not an option.

My suggestion is to use the LoadBalancerDrainingValve[1][2]. It was
written for this exact purpose. It's currently only available in
Tomcat 9.0.x, but you should be able to use it for previous Tomcat
versions as the Valve/Request/Response interfaces shouldn't have
changed in any incompatible ways between those versions.

Hope that helps,
- -chris

[1]
https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Load_Balancer
_Draining_Valve
[2]
https://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/valves/
LoadBalancerDrainingValve.html
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlqzurodHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFjpfBAAyuM5kfF/ukIcnJjd
NRoxyMIZtuKrVOht8tXn3or5ONye71Q/iZ3vd8UVlbrGurHWdi3ADH2n7Cvss8oX
+02XSRzkW4EAmtu0Ailpc5PBDW0j3ASZTqnkymtNyBjQ8MDQkYtizPql51SU6tOp
CaG4RP8TlEP91qI+nldCWMT+YbnAmAlEHvGOAJ1MzEKjmi14AfT8e4guBu2dfRCt
QXderPV9imVveBmP53Z3WklPDCRMfEmGCdUf25Be/5ZnUGDZ5wmAZl3l/HLnUBAD
tOwEBBCsm2OeVpvbbWj815ngnB/NkCC6gleePGN8J3HysJY+fnmPUl6Cw0t8jV3T
CbqUlXJfH54QRvzie+1eGXGK1iwX3++icfecusC2Rea/9of+s65OVCFoJVkHj1qY
3T/tWZm0dbqLqAbadE7/2ihrOPBg3VnW/vdD+/lKXBEv/ECH/9nYNY3OkY6mJ3KS
ptaKCdojTh1KCqxqilxfYEBMc9YFh1AoW/GYoF41mqFKRWc0CMLakCuNrm2vT8L0
u+KiFo8bPnuJ9Sw4jjKS2a52yp1jcJCjXnsDyO3vn7t3MNvyfygcbQR6Jftdq441
imwYVdwJTwULiR45cL6/AtGDSgKr1L4LhtcyhCzfxBRJh24W8u3dataH0loEVCup
uAZ1f50984WWHJMJYmI6UrA7lKI=
=8fI4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to