Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-9333

SessionsAndCrashesDUnitTest.sessionOperationsDoNotFail_whileServersAreRestarted may fail due to IndexOutOfBoundsException

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.15.0
    • Fix Version/s: 1.15.0
    • Component/s: redis
    • Labels:
      None

      Description

      Seen in a PR pre-checkin test run:

      org.apache.geode.redis.session.SessionsAndCrashesDUnitTest > sessionOperationsDoNotFail_whileServersAreRestarted FAILED
          java.lang.IndexOutOfBoundsException: Index -5 out of bounds for length 100
              at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
              at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
              at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
              at java.util.Objects.checkIndex(Objects.java:372)
              at java.util.ArrayList.get(ArrayList.java:459)
              at org.apache.geode.redis.session.SessionsAndCrashesDUnitTest.validateSessionAttributes(SessionsAndCrashesDUnitTest.java:179)
              at org.apache.geode.redis.session.SessionsAndCrashesDUnitTest.sessionOperationsDoNotFail_whileServersAreRestarted(SessionsAndCrashesDUnitTest.java:170)
      

      This occurs in the below block when totalUpdates is less than NUM_SESSIONS.

      for (int i = totalUpdates - NUM_SESSIONS; i < totalUpdates; i++) {
        int sessionIdx = i % NUM_SESSIONS;
        String sessionId = sessionIds.get(sessionIdx);
      ...
      

      Running the test locally with some trace logging added, it seems that totalUpdates is typically ~120, so if something were to cause updates to be 20% slower on a run of the test, this failure could show up. A solution might be to either await until at least NUM_SESSIONS updates have been performed by the updater threads, or to put in some logic to handle the case when totalUpdates is less than NUM_SESSIONS

        Attachments

          Activity

            People

            • Assignee:
              jens.deppe Jens Deppe
              Reporter:
              donalevans Donal Evans

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment