Do not allow WriteConflict exceptions to be thrown without context

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Execution Team 2022-08-22
    • 36
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The utility to throw WriteConflictException allows exceptions to be thrown without context. This makes it very difficult to diagnose errors that get returned to users (or JS tests in our case).

      We should remove the defaulted empty context from throwWriteConflictException and fill-in the ~30 places which currently use it with some more useful context.

      Also, the message "WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction." is a bit redundant and should perhaps be reworded like this:

      str::stream() << "WriteConflict occurred due to " << context << ". Please retry your operation or multi-document transaction."

            Assignee:
            Fausto Leyva (Inactive)
            Reporter:
            Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: