Skip to content

fix(NODE-6864): socket errors are not always converted to MongoNetworkErrors #4473

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
merged 6 commits into from
Apr 23, 2025

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Mar 18, 2025

Description

What is changing?

  • Ensure socket errors are converted
  • Do not squash error in finally block
Is there new documentation needed for these changes?

No

What is the motivation for this change?

Networking errors are handled specially for retry/resume logic, if we fail to wrap them in our Network error type we won't retry them.

Release Highlight

Socket errors are always treated as network errors

Network errors perform an important role in the driver, impacting topology monitoring processes and retryablity. A bug in the driver's socket implementation meant that in scenarios where server disconnects occurred while no operation was in progress on the socket resulted in errors that were not considered network errors.

Socket errors are now unconditionally treated as network errors.

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken force-pushed the NODE-6858-errors branch 3 times, most recently from 73db3ae to 7170418 Compare March 18, 2025 15:22
@nbbeeken nbbeeken force-pushed the NODE-6858-errors branch 2 times, most recently from 2d85944 to b868d0b Compare April 18, 2025 20:03
@nbbeeken nbbeeken marked this pull request as ready for review April 18, 2025 20:03
@nbbeeken nbbeeken requested a review from a team as a code owner April 18, 2025 20:03
@baileympearson baileympearson self-assigned this Apr 22, 2025
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 22, 2025
@baileympearson baileympearson merged commit 2d86095 into main Apr 23, 2025
27 of 30 checks passed
@baileympearson baileympearson deleted the NODE-6858-errors branch April 23, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants