|
48 | 48 | from cassandra.connection import (ConnectionException, ConnectionShutdown, |
49 | 49 | ConnectionHeartbeat, ProtocolVersionUnsupported, |
50 | 50 | EndPoint, DefaultEndPoint, DefaultEndPointFactory, |
51 | | - ContinuousPagingState, SniEndPointFactory) |
| 51 | + ContinuousPagingState, SniEndPointFactory, ConnectionBusy) |
52 | 52 | from cassandra.cqltypes import UserType |
53 | 53 | from cassandra.encoder import Encoder |
54 | 54 | from cassandra.protocol import (QueryMessage, ResultMessage, |
@@ -4445,15 +4445,18 @@ def _query(self, host, message=None, cb=None): |
4445 | 4445 | except NoConnectionsAvailable as exc: |
4446 | 4446 | log.debug("All connections for host %s are at capacity, moving to the next host", host) |
4447 | 4447 | self._errors[host] = exc |
4448 | | - return None |
| 4448 | + except ConnectionBusy as exc: |
| 4449 | + log.debug("Connection for host %s is busy, moving to the next host", host) |
| 4450 | + self._errors[host] = exc |
4449 | 4451 | except Exception as exc: |
4450 | 4452 | log.debug("Error querying host %s", host, exc_info=True) |
4451 | 4453 | self._errors[host] = exc |
4452 | 4454 | if self._metrics is not None: |
4453 | 4455 | self._metrics.on_connection_error() |
4454 | 4456 | if connection: |
4455 | 4457 | pool.return_connection(connection) |
4456 | | - return None |
| 4458 | + |
| 4459 | + return None |
4457 | 4460 |
|
4458 | 4461 | @property |
4459 | 4462 | def has_more_pages(self): |
|
0 commit comments