java-driver
java-driver copied to clipboard
Re-preparing of prepared statements should be throttled and limited
As we observed in issue #124, if there is some problem server-side with preparing statements, the driver will infinitely retry preparing the statement, without any delays between retries.
This could happen in two cases: if there is a bug in Scylla/Cassandra (like scylladb/scylla#10440) or if the prepared statement cache is too small to hold all prepared statements of a batch statement.
In such cases, the driver should throw an Exception, instead of endlessly looping and causing a massive load onto Scylla.
I have not checked whether other drivers have the same problem, but if they do, they too should be fixed.
Can be done on the client side as well for additional hardening.