Skip to content

GODRIVER-3298 Handle joined errors correctly in WithTransaction. #1928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

matthewdale
Copy link
Collaborator

GODRIVER-3298

Summary

  • Use errors.As to check for retryability of errors returned from the WithTransaction callback.

Background & Motivation

Currently WithTransaction uses custom error unwrapping logic to check if an error returned by the callback should be retried. That unwrapping logic was not updated when support for join-able errors was added to the Go stdlib. Instead of maintaining custom error unwrapping logic, use errors.As to make sure the code continues to support future stdlib updates.

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Feb 5, 2025
Copy link
Contributor

API Change Report

No changes found!

@matthewdale matthewdale merged commit f99da4d into mongodb:master Feb 6, 2025
33 of 35 checks passed
@matthewdale
Copy link
Collaborator Author

drivers-pr-bot please backport to release/2.0

@matthewdale
Copy link
Collaborator Author

drivers-pr-bot please backport to release/1.17

mongodb-drivers-pr-bot bot pushed a commit that referenced this pull request Feb 6, 2025
matthewdale added a commit that referenced this pull request Feb 14, 2025
…) [release/2.0] (#1931)

Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com>
alcaeus added a commit that referenced this pull request Mar 4, 2025
* release/2.0:
  BUMP v2.0.1
  GODRIVER-3477 Bump golang.org/x/crypto from 0.29.0 to 0.31.0 [release/2.0] (#1952)
  GODRIVER-3284 Allow valid SRV hostnames with less than 3 parts. (#1898) [release/2.0] (#1949)
  GODRIVER-3452 MergeClientOptions returns object when given nil arguments (#1917) [release/2.0] (#1948)
  GODRIVER-3443 Remove internal APIs in migration guide. (#1911) [release/2.0] (#1951)
  GODRIVER-3470 Correct BSON unmarshaling logic for null values (#1924) [master] (#1945) [release/2.0] (#1947)
  Fix erroneous nil error return in FindOne. (#1926) [release/2.0] (#1944)
  GODRIVER-3298 Handle joined errors correctly in WithTransaction. (#1928) [release/2.0] (#1931)
  GODRIVER-3307 clone returned byte slice in MarshalValue (#1913) [release/2.0] (#1921)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants