Allow multiple abortTransaction calls if the first one fails

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.17.2, 1.17.6, 2.4.0
    • Component/s: None
    • None
    • 🔵 Done
    • Go 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

      Detailed steps to reproduce the problem?

      Currently, Session.AbortTransaction ignores all errors returned when running the "abortTransaction" operation (see here). It also keeps track of the transaction state using a local state machine as described here), which forbids aborting a transaction that's already been aborted. The effect is that calling Session.AbortTransaction multiple times has no effect after the first call, even if the "abortTransaction" operation failed. That also provides users no insight into failures if they do happen, providing no information about how to fix them.

      Definition of done: what must be done to consider the task complete?

      • Update this line to capture and return the error if there is one.
      • Keep "s.clientSession.Aborting = true" if "abortTransaction" fails.
      • Set "s.clientSession.Aborting = false" if a new transaction is started using the same session.
      • Allow the state machine to transition from "in progress" to "starting".

      The exact Go version used, with patch level:

      The exact version of the Go driver used:

      v1.17.2, also reproduces with v1.17.6 and v2.4.0

      Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

      Sharded replica sets.

      The operating system and version (e.g. Windows 7, OSX 10.8, ...)

      macOS 15.7.2

      Security Vulnerabilities

      If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here

            Assignee:
            Unassigned
            Reporter:
            Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: