Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-37241

Add testing to verify proper expiration of sessions in the sessions collection

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.10, 4.0.6, 4.1.5
    • Component/s: None
    • Labels:
      None

      Description

      A lack of testing exists around verifying that sessions do indeed expire from the sessions collection when their lifetime is up.

      The session expiry time is a server parameter, measured in minutes. We may want to consider increasing the granularity to seconds so we don't make tests wait an abnormal amount of time.

      Proposed Fix

      1. Change the granularity of the logical session timeout to seconds instead of minutes. Since the drivers rely on the parameter "localLogicalSessionTimeoutMinutes" to exist in calls to isMaster(), I can take the following approaches:
        1. Create a duplicate parameter "logicalSessionTimeoutSeconds" which will be in the granularity of seconds... I'm not sure how this would work, and what precedent exists for duplicating parameters.
        2. Set the timeout to X seconds internally if test commands are enabled. I don't think this would play nicely with tests, but I haven't verified.
        3. Talk to drivers for a possible downstream change to "logicalSessionTimeoutSeconds" completely.
      2. Add a test case that will run "find, wait for TTL*0.5, getMore, wait for TTL*0.5, getMore, wait for TTL*0.5, getMore, close cursor, verify the session exists" i.e. verify that the cursors remain open and the session is not expired.
      3. Once the workload is over wait for the TTL *1.5 and check that there are no sessions in the collection
      4. No need to manually invoke any refresh commands, the getMore execution guarantees that sessions are there.

        Attachments

          Activity

            People

            Assignee:
            blake.oler Blake Oler
            Reporter:
            blake.oler Blake Oler
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: