Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1653

Ensure AbortTransaction can run even if context expires during WithTransaction

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • None

      In the WithTransaction code, we use the context passed to WithTransaction to call AbortTransaction. This means that AbortTransaction would fail if the context timed out or was cancelled during the execution of the user-supplied callback and we'd leave an in-progress transaction running after returning.

      I'm not sure how to best mitigate this. We could run AbortTransaction with context.Background() to ensure it can execute, but this is a deviation from the behavior of contexts because we shouldn't be doing blocking work once the context has expired.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: