SessionContext not being goroutine safe is awkward

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Do
    • Priority: Minor - P4
    • None
    • Affects Version/s: 0.1.0
    • Component/s: CRUD
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In Go, a context.Context is goroutine safe, and users expect this to be true. A mongo.SessionContext is not goroutine safe, even though it's used as a context.Context when being passed to methods. This causes confusion for users. Additionally, it is not clear to users that the context created by the WithSession function or UseSession* methods should not escape the scope of the closure.

      While it's likely to be usable by documenting that a mongo.SessionContext is not goroutine safe, it is likely that users will continue to attempt to use a mongo.SessionContext with goroutines, whether inside a closure or external to it.

              Assignee:
              Unassigned
              Reporter:
              Kristofer Brandow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: