Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-759

Drivers may defer checking if a deployment supports sessions until the session's first operation

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-3407 Backlog
      CXX-1858 Blocked
      PHPC-1469 Blocked
      SWIFT-647 Fixed 1.0.0-rc0
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-3407 Backlog CXX-1858 Blocked PHPC-1469 Blocked SWIFT-647 Fixed 1.0.0-rc0

    Description

      Previously, the sessions specification required that MongoClient.startSession report an error if the deployment does not support sessions.

      The spec has now been amended to permit drivers to defer checking for sessions support and reporting that error until the first time the session is used for an operation.

      Reporting this error from startSession is still permitted, so drivers may choose to not change anything.

      See changes:

      https://github.com/mongodb/specifications/commit/5efe2a1d4c7483920fbb11613652416acfb88ce7

      The rationale behind this change:

      Determining if a deployment supports sessions requires SDAM to have been started. However, some drivers lazily start SDAM the first time a client is used for an operation. If a user creates a client and then immediately starts a session, then startSession would have to perform I/O in order to check for support. For drivers with asynchronous APIs, this means that startSession would have to be an asynchronous method to comply with the spec. This is not ideal; the API becomes unnecessarily clunky and adds the overhead of a promise every time it is used, even though in the majority of cases startSession will require no I/O.

      Allowing the error to be reported later on when the session is used for an operation means that startSession can be implemented in a way that never performs I/O.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: