ExportXMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • 3
    • Go Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Currently, there's a bunch of logic that tries to pick which error to return after a failed retry. That logic frequently discards important error information and makes it difficult or impossible to troubleshoot problems without a bunch of additional event monitoring or logging enabled. It would be much more useful to collect all error information for all operation attempts and return them in one error, painting a much more complete picture of the history of a given operation in a single error value. To do that, we should use errors.Join to join all errors that happen while attempting a given operation together.

      Definition of done

      • Join all errors together that happen during Operation.Execute retries if the final attempt doesn't succeed. Return the joined error.
      • Join all errors that happen during WithTransaction retries if the final attempt doesn't succeed.
      • Join all errors that happen during ChangeStream.executeOperation retries if the final attempt doesn't succeed.

      Don't use the "internal/errutil" package because it's unnecessary now that the min Go version is 1.25. We will remove that package completely with GODRIVER-4063.

      Open questions:

      • What happens if unified spec test assertions fail? Can we resolve them by making sure error assertions use errors.Is or errors.As?

      Pitfalls

      • We've never joined errors together. It's possible there will be unexpected error handling bugs introduced by returning joined errors.

            Assignee:
            Matt Dale
            Reporter:
            Matt Dale
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 3 weeks
                3w
                Remaining:
                Remaining Estimate - 3 weeks
                3w
                Logged:
                Time Spent - Not Specified
                Not Specified