(self, error: BaseException)
| 992 | self.size_cond.notify() |
| 993 | |
| 994 | def _handle_connection_error(self, error: BaseException) -> None: |
| 995 | # Handle system overload condition for non-sdam pools. |
| 996 | # Look for errors of type AutoReconnect and add error labels if appropriate. |
| 997 | if self.is_sdam or type(error) not in (AutoReconnect, NetworkTimeout): |
| 998 | return |
| 999 | assert isinstance(error, AutoReconnect) # Appease type checker. |
| 1000 | # If the original error was a DNS, certificate, or SSL error, ignore it. |
| 1001 | if isinstance(error.__cause__, (_CertificateError, SSLErrors, socket.gaierror)): |
| 1002 | # End of file errors are excluded, because the server may have disconnected |
| 1003 | # during the handshake. |
| 1004 | if not isinstance(error.__cause__, (ssl.SSLEOFError, ssl.SSLZeroReturnError)): |
| 1005 | return |
| 1006 | error._add_error_label("SystemOverloadedError") |
| 1007 | error._add_error_label("RetryableError") |
| 1008 | |
| 1009 | async def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> AsyncConnection: |
| 1010 | """Connect to Mongo and return a new AsyncConnection. |
no test coverage detected