Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-66998

Do not allow WriteConflict exceptions to be thrown without context

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

      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@mongodb.com Fausto Leyva (Inactive)
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: