Skip to content
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

GODRIVER-3145 Don't retry on context timeout or cancellation. #1598

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

matthewdale
Copy link
Collaborator

@matthewdale matthewdale commented Apr 10, 2024

GODRIVER-3145

Summary

  • Prevent operations from retrying when a context times out or is canceled.
  • Add a test that checks for unexpected retries when a context times out.

Background & Motivation

Currently the driver can start to retry an operation if the operation times out during certain phases of execution. If that happens, the operation may return a confusing error message that obfuscates the original error. Instead, the driver should return the original error if it was caused by a context.Canceled or context.DeadlineExceeded.

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Apr 10, 2024
Copy link

mongodb-drivers-pr-bot bot commented Apr 10, 2024

API Change Report

No changes found!

@matthewdale matthewdale force-pushed the godriver3145-dont-retry-ctx branch 2 times, most recently from 3596325 to 2edc4ec Compare April 12, 2024 03:57
@matthewdale matthewdale marked this pull request as ready for review April 12, 2024 04:03
@matthewdale matthewdale added priority-1-high High Priority PR for Review and removed priority-3-low Low Priority PR for Review labels Apr 12, 2024
blink1073
blink1073 previously approved these changes Apr 12, 2024
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

mongo/integration/client_test.go Outdated Show resolved Hide resolved
mongo/integration/client_test.go Outdated Show resolved Hide resolved
mongo/integration/client_test.go Outdated Show resolved Hide resolved
@matthewdale matthewdale merged commit 86cb647 into mongodb:v1 Apr 12, 2024
27 of 33 checks passed
blink1073 pushed a commit to blink1073/mongo-go-driver that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-1-high High Priority PR for Review
Projects
None yet
3 participants