Problem
Several ResponseFuture continuations hand work to Session.submit(). During shutdown, submission can return None or raise after executor teardown, leaving the owning future pending indefinitely when timeout=None.
|
# Known limitation: this retry goes around the RetryPolicy and |
|
# _query_retries, because both are keyed to the user's statement |
|
# and this is the driver's own USE. It also has no backoff, so a |
|
# flapping control connection re-sends USE until the client-side |
|
# timeout fires instead of failing fast. Routing it through the |
|
# retry machinery shared with the pooled path would be the fix. |
|
self.session.submit(self._retry_task, False, host) |
|
def _reprepare(self, prepare_message, host, connection, pool): |
|
cb = partial(self.session.submit, self._execute_after_prepare, host, connection, pool) |
|
if pool is None and connection is not None and connection.is_control_connection: |
The fallback USE, reprepare, schema-refresh, and prepared-query paths share this handoff pattern. This was found while narrowing #392.
Expected behavior
A rejected internal handoff completes its ResponseFuture exactly once with an existing shutdown exception. Internal work must not be counted as a retry-policy decision.
Acceptance criteria
- Shutdown or executor rejection cannot strand these internal continuations.
- Completion remains single-shot when a response races rejection.
- Unit tests cover the affected handoffs with
timeout=None.
Problem
Several
ResponseFuturecontinuations hand work toSession.submit(). During shutdown, submission can returnNoneor raise after executor teardown, leaving the owning future pending indefinitely whentimeout=None.python-driver/cassandra/cluster.py
Lines 5611 to 5617 in 5651509
python-driver/cassandra/cluster.py
Lines 5914 to 5916 in 5651509
The fallback
USE, reprepare, schema-refresh, and prepared-query paths share this handoff pattern. This was found while narrowing #392.Expected behavior
A rejected internal handoff completes its
ResponseFutureexactly once with an existing shutdown exception. Internal work must not be counted as a retry-policy decision.Acceptance criteria
timeout=None.