12 Replies Latest reply on Mar 31, 2014 8:34 AM by Radoslav Husar

    Clustering without sticky sessions

    Art O Cathain Newbie

      Is it possible to use JBoss behind a DNS-based load balancer (i.e. without sticky sessions)?


      When I set up two JBosses in a cluster on my local machine, and hit a simple test application (see https://github.com/artbristol/jbossexample) from two browser tabs simultaneously, frequently one browser tab times out, and you see the following in the logs


      JBWEB001018: An exception or error occurred in the container during the request processing: java.lang.RuntimeException: JBAS018060: Exception acquiring ownership of...


      All subsequent requests to that node are extremely slow. I've done some debugging - it seems one of the nodes is incorrectly hanging onto the session lock despite having finished serving the request. If you up the logging, you can see repeated instances of


      DEBUG [org.jboss.as.clustering] (http-/ [//] Received FAIL response from nodeMain/web -- reports lock is held by nodeMain/web


      This happens in AS 7.2.0, EAP 6.1.0.Final, and EAP 6.2.0.Beta


      Steps to reproduce:


      1. Build https://github.com/artbristol/jbossexample
      2. Unzip two copies of JBoss EAP 6.2 into separate directories and deploy jbossexample.war into standalone/deployments
      3. Start one with standalone.bat --server-config standalone-ha.xml
      4. Start the other with standalone.bat --server-config standalone-ha.xml -Djboss.socket.binding.port-offset=100 -Djboss.node.name=plus100
      5. Start Firefox with one tab pointed at http://localhost:8080/jbossexample/get and the other at http://localhost:8180/jbossexample/get
      6. In Firefox, right click and choose 'Reload All Tabs' (You might need to try this 5-10 times before it fails)