Consolidate session/transaction helpers into a shared file

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      In pymongo/asynchronous/client_session.py, the _TxnState, _EmptyServerSession, _ServerSession, _ServerSessionPool classes are all identical between async and sync. They can be lifted to a shared file unchanged.

      SessionOptions and TransactionOptions can also be consolidated into shared classes, with minor complications caused by docstring references to async/sync classes. These can either be generalized to be IO-agnostic or resolved with stub subclasses to keep the current split references.

      The top-level module methods _make_timeout_error, _max_time_expired_error, _reraise_with_unknown_commit, _within_time_limit, _WITH_TRANSACTION_RETRY_TIME_LIMIT, _BACKOFF_MAX, _BACKOFF_INITIAL, _validate_session_write_concern can also be consolidated.

            Assignee:
            Noah Stapp
            Reporter:
            Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: