3

We are facing one issue in a Struts application deployed in JBOSS clustered environment with load balancer and sticky session

Issue description

1) This issue happens in a user registration functionality which has 2 pages, register1.do and register2.do page

2) When user clicks on registration url, https://ourwebsite.com/register1.do

Two GET request are made

GET register1.do (Gets 1st registration page and sets few values in session)

GET captcha.do (This loads a captcha image to be shown on register1.do)

3) Sometimes what happens is GET request to register1.do sets a JSESSIONID cookie and the GET request to captcha.do over write JSESSIONID cookie set by first request. This causes problem in 2nd registration page as it fetches some of the values stored in session and as the session is overwritten by captcha no values can be obtained. see below image

enter image description here

4) This scenario does not happen every time, once this issue occurs and if we go back to register1.do page a refresh(F5)/hard refresh (Ctrl + F5) then GET request to captcha.do does not over write JSESSIONID cookie and user registration works fine.

Moreover this happens only in clustered environment, in single JBOSS environment it works fine.

  • Can anyone please help me to identify what could be possible problem here ?

  • Why session does not get over written when we do a page refresh ?

manurajhada
  • 5,284
  • 3
  • 24
  • 43
  • 1
    I have a similar issue using mod_cluster to load balance from apache to two JBoss servers. It appears that mod_cluster isn't respecting session stickyness and I have yet to find a solution to solve it. What is your technology stack like? – Welsh Oct 18 '13 at 22:20
  • I have similar issue for JBoss EAP 7 cluster using mod_cluster 1.3.1. I am sharing link to my question: [link] (http://stackoverflow.com/questions/43454068/load-balancing-cluster-not-working-with-apache-http-server-2-4-6-and-jboss-eap-7) – Aditya Neurgaonkar May 04 '17 at 13:57

2 Answers2

1

Update your apache mod_cluster binaries to mod_cluster 1.2.6.Final which are available here.

This solved it for me, which was jumping servers after every single refresh. Hopefully that helps.

Welsh
  • 5,138
  • 3
  • 29
  • 43
  • For me it does not fail most of the time. It occurs we open a new browser intance and try registering, if we press F5/Ctrl+F5 (once error occurs) then it works fine on same browser instance and the error does not come again. One pattern which we found is whenever JSESSSION id comes in url, it fails. – manurajhada Oct 29 '13 at 15:11
  • That is an old bug, the current [mod_cluster 1.3.1.Final](https://developer.jboss.org/wiki/ModclusterVersion131FinalReleased) handles JSESSIONID in url. – Michal Karm Babacek May 18 '15 at 07:31
0

I also experienced the same problem with jboss eap 6.1 and in load balancer i'm going with mod_cluster configuration I changed algorithm from server per session to entry per session and sticky session is working well and good .Go through the following to know about entry per session and server per session.

Entry-per-Session means that the device creates additional client-table entries whenever a source IP opens a new session (unique source port). This gives the unit more accurate tracking of the number of sessions, but it's behavior is to continue sending all the traffic from the client's source IP to the same server.

In Server-per-Session mode, the device tracks the unique source ports the same way, but when the client opens a new session, the device makes a new load-balancing decision for the new session. This way multiple sessions from the same client IP can be 'sprayed' among all the servers rather than being stuck to a single server.