Timeouts during batch statement execution

148 views
Skip to first unread message

Earl Lapus

unread,
Oct 26, 2017, 12:29:55 PM10/26/17
to DataStax Python Driver for Apache Cassandra User Mailing List

Hi All,

I am frequently getting the following exception when executing batch statements:

File "cassandra/cluster.py", line 1710, in cassandra.cluster.Session.execute08:26:58

File "cassandra/cluster.py", line 3343, in cassandra.cluster.ResponseFuture.result08:26:58

cassandra.protocol.ServerError: <Error from server: code=0000 [Server error] message="com.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ReadTimeoutException: Operation timed out - received only 4 responses.">

I've set the consistency level of my BatchSatement object to LOCAL_QUORUM.

Can anyone point me to a any config or settings in my connection that I should check or tweak to somehow resolve this issue?

Thanks,
Earl

Alan Boudreault

unread,
Oct 26, 2017, 12:48:00 PM10/26/17
to python-dr...@lists.datastax.com
Hello,

How much data are you trying to fetch with that batch statement? The error happens on the server. You might be interested to look at your `read_request_timeout_in_ms` cassandra setting (and other *timeout* options). 

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.



--

Alan Boudreault
Software Engineer (Drivers) | alan.bo...@datastax.com


Earl Lapus

unread,
Oct 26, 2017, 1:14:18 PM10/26/17
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi,


On Thursday, October 26, 2017 at 9:48:00 AM UTC-7, Alan Boudreault wrote:
Hello,

How much data are you trying to fetch with that batch statement? The error happens on the server. You might be interested to look at your `read_request_timeout_in_ms` cassandra setting (and other *timeout* options). 


The batch statement are actually inserts, it is not fetching anything.
I'll try checking the read_request_timeout_in_ms value in the server.

Thanks Alan...

-Earl-

Earl Lapus

unread,
Oct 27, 2017, 11:34:51 AM10/27/17
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi,


How much data are you trying to fetch with that batch statement? The error happens on the server. You might be interested to look at your `read_request_timeout_in_ms` cassandra setting (and other *timeout* options). 


The batch statement are actually inserts, it is not fetching anything.
I'll try checking the read_request_timeout_in_ms value in the server.


So, apparently I do not have access to the server... I do not know the exact value that is assigned to read_request_timeout_in_ms.

However, I tried playing around with the cassandra.policies.RetryPolicy class and tried setting that to retry_policy of the BatchStatement object to RETRY.
What happened was that the program runs longer (~4 times longer, so it is able to insert more data) before it eventually times out.

Is this a right path to somehow mitigate the issue without having to change anything on the server? What about the RETRY_NEXT_HOST... is it a viable option for the retry policy given the issues I am experiencing?

Thanks,
Earl

Alan Boudreault

unread,
Oct 31, 2017, 10:04:04 AM10/31/17
to python-dr...@lists.datastax.com
Well, if your frequently get that timeout error, it might be better to change the way your app works and/or split into multiple smaller batches. Otherwise, yeah the retry policy could be a way to mitigate the issue for the moment.

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.
Reply all
Reply to author
Forward
0 new messages