Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-463

Undertow mod_cluster proxy: Failover doesn't keep the same session

XMLWordPrintable

    • Hide

      Play with clusterbench.war, start/stop workers.

      Show
      Play with clusterbench.war , start/stop workers.

      Despite the fact that both workers are properly registered with the Undertow mod_cluster proxy balancer, e.g.

      Registering context /clusterbench, for node worker-2, with aliases [default-host, localhost, karm.brq.redhat.com]
      Received node load in STATUS message, node jvmRoute: worker-2, load: 61
      

      it appears that the session data ain't kept during failover (clustered web app):

      Both worker-1 and worker-2 are up and running

      First request, establishes a new session

      mbabacek@localhost:~/WILDFLY$ curl http://karm.brq.redhat.com:8080/clusterbench/requestinfo -b cookie.txt -c cookie.txt
      Request URI: /clusterbench/requestinfo
      Headers: {Accept=*/*, User-Agent=curl/7.32.0, X-Forwarded-Proto=http, X-Forwarded-Host=karm.brq.redhat.com, X-Forwarded-For=10.40.4.50, Host=karm.brq.redhat.com:8080, Content-Length=0, X-Forwarded-Port=8080, X-Forwarded-Server=karm.brq.redhat.com}
      JVM route: worker-1
      Session ID: fcdg9fCs4vHcKY9oiEo2zsG2M9yiy-Nlqs2CXa14
      Session isNew: true
      Servlet specific info: Session tracking mode: [URL, COOKIE]
      

      Second request, session is not new any more

      mbabacek@localhost:~/WILDFLY$ curl http://karm.brq.redhat.com:8080/clusterbench/requestinfo -b cookie.txt -c cookie.txt
      Request URI: /clusterbench/requestinfo
      Headers: {Cookie=JSESSIONID=fcdg9fCs4vHcKY9oiEo2zsG2M9yiy-Nlqs2CXa14.worker-1, Accept=*/*, User-Agent=curl/7.32.0, X-Forwarded-Proto=http, X-Forwarded-Host=karm.brq.redhat.com, X-Forwarded-For=10.40.4.50, Host=karm.brq.redhat.com:8080, Content-Length=0, X-Forwarded-Port=8080, X-Forwarded-Server=karm.brq.redhat.com}
      JVM route: worker-1
      Session ID: fcdg9fCs4vHcKY9oiEo2zsG2M9yiy-Nlqs2CXa14
      Session isNew: false
      Servlet specific info: Session tracking mode: [URL, COOKIE]
      

      Third request, session is the same, sticks to worker-1, correct

      mbabacek@localhost:~/WILDFLY$ curl http://karm.brq.redhat.com:8080/clusterbench/requestinfo -b cookie.txt -c cookie.txt
      Request URI: /clusterbench/requestinfo
      Headers: {Cookie=JSESSIONID=fcdg9fCs4vHcKY9oiEo2zsG2M9yiy-Nlqs2CXa14.worker-1, Accept=*/*, User-Agent=curl/7.32.0, X-Forwarded-Proto=http, X-Forwarded-Host=karm.brq.redhat.com, X-Forwarded-For=10.40.4.50, Host=karm.brq.redhat.com:8080, Content-Length=0, X-Forwarded-Port=8080, X-Forwarded-Server=karm.brq.redhat.com}
      JVM route: worker-1
      Session ID: fcdg9fCs4vHcKY9oiEo2zsG2M9yiy-Nlqs2CXa14
      Session isNew: false
      Servlet specific info: Session tracking mode: [URL, COOKIE]
      

      worker-1 has been shut down, failover ought to take place

      This is wrong. worker-2 should take care about it without creating a new session

      mbabacek@localhost:~/WILDFLY$ curl http://karm.brq.redhat.com:8080/clusterbench/requestinfo -b cookie.txt -c cookie.txt
      Request URI: /clusterbench/requestinfo
      Headers: {Cookie=JSESSIONID=fcdg9fCs4vHcKY9oiEo2zsG2M9yiy-Nlqs2CXa14.worker-1, Accept=*/*, User-Agent=curl/7.32.0, X-Forwarded-Proto=http, X-Forwarded-Host=karm.brq.redhat.com, X-Forwarded-For=10.40.4.50, Host=karm.brq.redhat.com:8080, Content-Length=0, X-Forwarded-Port=8080, X-Forwarded-Server=karm.brq.redhat.com}
      JVM route: worker-2
      Session ID: 8MDTWJ5x9_ixqH4FG7jGj247UxzswK-JF8o6rJzJ
      Session isNew: true
      Servlet specific info: Session tracking mode: [URL, COOKIE]
      

      Subsequent requests stick to the new session

      mbabacek@localhost:~/WILDFLY$ curl http://karm.brq.redhat.com:8080/clusterbench/requestinfo -b cookie.txt -c cookie.txt
      Request URI: /clusterbench/requestinfo
      Headers: {Cookie=JSESSIONID=8MDTWJ5x9_ixqH4FG7jGj247UxzswK-JF8o6rJzJ.worker-2, Accept=*/*, User-Agent=curl/7.32.0, X-Forwarded-Proto=http, X-Forwarded-Host=karm.brq.redhat.com, X-Forwarded-For=10.40.4.50, Host=karm.brq.redhat.com:8080, Content-Length=0, X-Forwarded-Port=8080, X-Forwarded-Server=karm.brq.redhat.com}
      JVM route: worker-2
      Session ID: 8MDTWJ5x9_ixqH4FG7jGj247UxzswK-JF8o6rJzJ
      Session isNew: false
      Servlet specific info: Session tracking mode: [URL, COOKIE]
      

      Ideas?

              mbabacek1@redhat.com Karm Karm
              mbabacek1@redhat.com Karm Karm
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: