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

Do not allow WriteConflict exceptions to be thrown without context

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Execution Team 2022-08-22
    • 36

    Description

      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."

      Attachments

        Activity

          People

            fausto.leyva@mongodb.com Fausto Leyva (Inactive)
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: