RetryPolicy "wait before retry" support #1154
Labels
API-breaking
This might introduce incompatible API changes
area/statement-execution
enhancement
New feature or request
In some other drivers retry policies support waiting before retrying. We should discuss if we want this.
This can be implemented to implement e.g. expotential backoff retry policy, present in some other driver.
Java Driver 4 explicitly says that it does not have this capability, and waiting before retry should be implemented in user code: https://java-[driver.docs.scylladb.com/scylla-4.15.0.x/api/index.html](https://java-driver.docs.scylladb.com/scylla-4.15.0.x/api/com/datastax/oss/driver/api/core/retry/RetryPolicy.html)
Java Driver 3 also does not have such capability in its RetryDecision:
https://java-driver.docs.scylladb.com/scylla-3.11.2.x/api/com/datastax/driver/core/policies/RetryPolicy.html
https://java-driver.docs.scylladb.com/scylla-3.11.2.x/api/com/datastax/driver/core/policies/RetryPolicy.RetryDecision.html
GoCql has this policy: https://github.com/scylladb/gocql/blob/e12494df329053d63aa205ffd4d7082587ea72bd/policies.go#L174-L178
Python driver has this capability, but of course implemented in a weird way (because it is not possible to write good code in Python). RetryPolicy is documented to return 2-element tuple from its methods (first element is retry decision, second is consistency), but it can actually return 3 elements, where third is the time to wait before retry. scylladb/python-driver@f4eabdf
C++ driver does not have this capability.
The fact that Java Driver does not have this capability is a signal to me that perhaps there are some issues with it.
The one that comes to my mind is interacting badly with client-side timeout.
The text was updated successfully, but these errors were encountered: