Skip to content

RUBY-3750 Clarify NoWritesPerformed error label#3016

Merged
comandeo-mongo merged 1 commit intomongodb:masterfrom
comandeo:3750
Apr 13, 2026
Merged

RUBY-3750 Clarify NoWritesPerformed error label#3016
comandeo-mongo merged 1 commit intomongodb:masterfrom
comandeo:3750

Conversation

@comandeo-mongo
Copy link
Copy Markdown
Contributor

When the overload retry loop encounters multiple errors, the driver now returns the correct error based on NoWritesPerformed labels per the DRIVERS-3326 spec clarification. If all errors indicate no write was attempted, the first error is returned; if mixed, the most recent write-attempted error is returned. Adds three new retryable writes prose tests (spec test 6, cases 1-3).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates retryable writes overload backoff behavior to return the correct error when multiple errors are encountered, following the clarified NoWritesPerformed label rules from the retryable writes spec.

Changes:

  • Track and raise error_to_raise (instead of always raising the most recent error) in the overload retry paths based on NoWritesPerformed.
  • Update diagnostic note attachment to apply to the error that will be raised.
  • Add Retryable Writes Prose Test 6 coverage (cases 1–3) for error propagation across multiple errors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
lib/mongo/retryable/write_worker.rb Adjusts overload retry loops to select the correct error to raise using NoWritesPerformed rules.
spec/mongo/retryable/retryable_writes_error_propagation_prose_spec.rb Adds new prose spec cases verifying correct error propagation behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/mongo/retryable/retryable_writes_error_propagation_prose_spec.rb Outdated
Comment thread spec/mongo/retryable/retryable_writes_error_propagation_prose_spec.rb Outdated
Comment thread spec/mongo/retryable/retryable_writes_error_propagation_prose_spec.rb Outdated
@comandeo-mongo comandeo-mongo marked this pull request as draft April 13, 2026 12:51
@comandeo-mongo comandeo-mongo marked this pull request as ready for review April 13, 2026 13:13
@comandeo-mongo comandeo-mongo merged commit 138a909 into mongodb:master Apr 13, 2026
201 of 204 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants