Add timeout and in-flight observability to OperationTimedOut#818
Draft
mykaul wants to merge 2 commits intoscylladb:masterfrom
Draft
Add timeout and in-flight observability to OperationTimedOut#818mykaul wants to merge 2 commits intoscylladb:masterfrom
mykaul wants to merge 2 commits intoscylladb:masterfrom
Conversation
The error message at Cluster.add_execution_profile() had an unfilled %s placeholder: 'Failed to create all new connection pools in the %ss timeout.' The pool_wait_timeout value was never interpolated into the string, so users would see a literal '%s' instead of the actual timeout value. Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
Improve timeout observability in the driver, inspired by the Go driver PR scylladb/gocql#847. OperationTimedOut now carries optional timeout and in_flight fields that are appended to the exception message when present (e.g. "(timeout=10.0s, in_flight=42)"). All seven production raise sites in connection.py and cluster.py pass these values where available. Additionally, debug-level log lines are emitted for: - Client-side request timeouts (host, timeout, in_flight, orphaned) - Server-side read/write timeouts (host, consistency, received/required, data_retrieved/write_type, retry decision) A helper _retry_decision_name() translates RetryPolicy constants to human-readable strings for the log messages. New keyword-only parameters are backward compatible — existing callers that pass only positional errors/last_host continue to work unchanged. Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve timeout observability in the Python driver, inspired by the Go driver PR scylladb/gocql#847.
%sformat string inadd_execution_profiletimeout message (cherry-pickable)timeoutandin_flightfields toOperationTimedOut, debug logging for client-side and server-side timeoutsChanges
OperationTimedOutenhancement (cassandra/__init__.py)timeoutandin_flightkeyword parameters (backward compatible)(timeout=Xs, in_flight=N)when timeout is setNoneor0, no timeout info is printedClient-side timeout observability (
cassandra/connection.py,cassandra/cluster.py)timeout=andin_flight=where availableServer-side timeout logging (
cassandra/cluster.py)_retry_decision_name()helper translates RetryPolicy constants to human-readable namesTests
OperationTimedOutmessage formatting and attribute accesstimeoutandin_flightvalues