-
Notifications
You must be signed in to change notification settings - Fork 1.2k
PYTHON-5875 - Wrap SSL handshake errors before labeling with overload #2866
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1061,10 +1061,16 @@ async def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> A | |
| reason=_verbose_connection_error_reason(ConnectionClosedReason.ERROR), | ||
| error=ConnectionClosedReason.ERROR, | ||
| ) | ||
| self._handle_connection_error(error) | ||
| if isinstance(error, (IOError, OSError, *SSLErrors)): | ||
| details = _get_timeout_details(self.opts) | ||
| _raise_connection_failure(self.address, error, timeout_details=details) | ||
| # Wrap to AutoReconnect/NetworkTimeout BEFORE labeling so the | ||
| # SystemOverloadedError label lands on the propagated exception. | ||
| try: | ||
| _raise_connection_failure(self.address, error, timeout_details=details) | ||
| except (AutoReconnect, NetworkTimeout) as wrapped: | ||
| self._handle_connection_error(wrapped) | ||
| raise | ||
| self._handle_connection_error(error) | ||
|
Comment on lines
1064
to
+1073
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the relevant part of the CMAP spec, the only types of establishment errors that MUST be excluded from having the backpressure labels applied are the following:
This change then correctly addresses a bug in the driver where errors that MUST be labeled as possible overload errors are not. |
||
| raise | ||
|
|
||
| conn = AsyncConnection(networking_interface, self, self.address, conn_id, self.is_sdam) # type: ignore[arg-type] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.