java-driver icon indicating copy to clipboard operation
java-driver copied to clipboard

Re-preparing of prepared statements should be throttled and limited

Open avelanarius opened this issue 3 years ago • 2 comments

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.

avelanarius avatar Apr 28 '22 17:04 avelanarius

I have not checked whether other drivers have the same problem, but if they do, they too should be fixed.

avelanarius avatar Apr 28 '22 17:04 avelanarius

Can be done on the client side as well for additional hardening.

roydahan avatar Jun 13 '24 13:06 roydahan