glassfish
  1. glassfish
  2. GLASSFISH-15538

EJB Ref failover does not happen with SSO

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1_b35
    • Fix Version/s: 3.1_b37
    • Component/s: failover
    • Labels:
      None

      Description

      This test failure happens only in Modified attribute case

      Scenario:

      CMP App with ejbref stored in http session, with SSO enabled

      Store ejbref in http session
      Kill the instance where the request is handled
      Access the ejbref and make a method call on the ejb

      It fails to recover the session, new session is created upon failover

        Activity

        Hide
        Mahesh Kannan added a comment -

        Issue was that web-ha/compositeMetadata's getVersion() was always returning zero. Also, fixed some of the read calls that read data into byte[]

        svn diff
        Index: src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java
        ===================================================================
        — src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java (revision 44457)
        +++ src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java (working copy)
        @@ -162,7 +162,7 @@
        }

        public long getVersion()

        { - return 0L; + return version; }

        @Override
        @@ -292,7 +292,7 @@
        int len = dis.readInt();
        if (len > 0)

        { state = new byte[len]; - dis.read(state); + dis.readFully(state); }

        }

        @@ -300,7 +300,7 @@
        int len = dis.readInt();
        if (len > 0)

        { byte[] sd = new byte[len]; - dis.read(sd); + dis.readFully(sd); stringExtraParam = new String(sd); }

        }
        @@ -311,13 +311,13 @@

        int opNameLen = dis.readInt();
        byte[] opnameData = new byte[opNameLen];

        • dis.read(opnameData);
          + dis.readFully(opnameData);
          String opName = new String(opnameData);

        int attrNameLen = dis.readInt();
        if (attrNameLen > 0) {
        byte[] sd = new byte[attrNameLen];

        • dis.read(sd);
          + dis.readFully(sd);
          String attrName = new String(sd);

        SessionAttributeMetadata.Operation smdOpcode = SessionAttributeMetadata.Operation.valueOf(opName);
        @@ -326,7 +326,7 @@
        case UPDATE:
        int dataLen = dis.readInt();
        byte[] attrData = new byte[dataLen];

        • dis.read(attrData);
          + dis.readFully(attrData);
          attributesMap.put(attrName, new SessionAttributeMetadata(attrName, smdOpcode, attrData));
          break;
        Show
        Mahesh Kannan added a comment - Issue was that web-ha/compositeMetadata's getVersion() was always returning zero. Also, fixed some of the read calls that read data into byte[] svn diff Index: src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java =================================================================== — src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java (revision 44457) +++ src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java (working copy) @@ -162,7 +162,7 @@ } public long getVersion() { - return 0L; + return version; } @Override @@ -292,7 +292,7 @@ int len = dis.readInt(); if (len > 0) { state = new byte[len]; - dis.read(state); + dis.readFully(state); } } @@ -300,7 +300,7 @@ int len = dis.readInt(); if (len > 0) { byte[] sd = new byte[len]; - dis.read(sd); + dis.readFully(sd); stringExtraParam = new String(sd); } } @@ -311,13 +311,13 @@ int opNameLen = dis.readInt(); byte[] opnameData = new byte [opNameLen] ; dis.read(opnameData); + dis.readFully(opnameData); String opName = new String(opnameData); int attrNameLen = dis.readInt(); if (attrNameLen > 0) { byte[] sd = new byte [attrNameLen] ; dis.read(sd); + dis.readFully(sd); String attrName = new String(sd); SessionAttributeMetadata.Operation smdOpcode = SessionAttributeMetadata.Operation.valueOf(opName); @@ -326,7 +326,7 @@ case UPDATE: int dataLen = dis.readInt(); byte[] attrData = new byte [dataLen] ; dis.read(attrData); + dis.readFully(attrData); attributesMap.put(attrName, new SessionAttributeMetadata(attrName, smdOpcode, attrData)); break;
        Hide
        Mahesh Kannan added a comment -

        How often does it happen? (Frequency)
        Intermittent. Also, this occurs only in Modified attribute tests

        How much effort is required to fix it? (Cost)
        Simple. See diffs above

        What is the risk of fixing it? (Risk)
        Very very low. I have run the (failing) DFT test. I will be running more DFT tests before checking in.

        Does a work around for the issue exist? Can the workaround be reasonably employed by the end user?
        Unfortunately no

        If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes?
        No, this breaks the modified-attribute feature.

        Show
        Mahesh Kannan added a comment - How often does it happen? (Frequency) Intermittent. Also, this occurs only in Modified attribute tests How much effort is required to fix it? (Cost) Simple. See diffs above What is the risk of fixing it? (Risk) Very very low. I have run the (failing) DFT test. I will be running more DFT tests before checking in. Does a work around for the issue exist? Can the workaround be reasonably employed by the end user? Unfortunately no If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes? No, this breaks the modified-attribute feature.
        Hide
        Mahesh Kannan added a comment -

        svn commit -m "Fix for 15538"
        Sending web-ha/src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java
        Transmitting file data .
        Committed revision 44499.

        Show
        Mahesh Kannan added a comment - svn commit -m "Fix for 15538" Sending web-ha/src/main/java/org/glassfish/web/ha/session/management/CompositeMetadata.java Transmitting file data . Committed revision 44499.

          People

          • Assignee:
            Mahesh Kannan
            Reporter:
            gopaljorapur
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: