Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6389

JvmRouteValve doesn't handle domain included in jvmRoute

    XMLWordPrintable

Details

    Description

      From a email thread, me replying to Paul Ferraro:

      >> OK - I just tested this. In summary, defining the domain within the
      >> route directive does not work. e.g. worker.node1.route=group1.node1
      >>
      >> If I use jvmRoute="node1" in server.xml, then .node1 is appended to the
      >> session id, but the sessions do not stick, so subsequent requests go to
      >> some other node.
      >>
      >> If I use jvmRoute="group1.node1" in server.xml, then .group1.node1 is
      >> appended to the session id and the next request gets routed to node1
      >> again (i.e. the session sticks) - but, now .group1.group1.node1 is
      >> appended the session id (which is not a valid node) - so the next
      >> request after this one goes to some other node.
      >>
      >> I would say this is a bug - but according to mladen, I'm not using
      >> domains the way they were intended to be used... Thoughts?
      >>
      >> For now, I'll drop this section (that mentions defining domain within
      >> the route directive) from the wiki page.
      >>
      >
      > This behavior could be due to an implementation detail of the JvmRouteValve, which parses out the jvmRoute from the session id starting on the right and looking for '.' This would cause the 2nd request to > be treated as a failover, since the parsed value would be "node1" will the server.xml value is "group1.node1". The session cookie will be re-emitted, now xxx.group1.group1.node1. Next request would be
      > xxx.group1.group1.group1.node1, etc.

      Looking for the '.' from the right (using String.lastIndexOf() instead of indexOf()) is a minor perf optimization.

      Simple solution is to look for the '.' from the left. More complex would be to count the '.' instances in the node's jvmRoute and count from the right. Or, count from the left if there is a '.' in the jvmRoute.

      Attachments

        Activity

          People

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: