Recreating session and inserting it into ResultSet in middle of iterating over a big table

7 views
Skip to first unread message

Bhuvan Rawal

unread,
Jun 10, 2016, 4:08:29 AM6/10/16
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi,

I was iterating over a big result set (160M) using default driver paging but in the middle this exception was encountered:
NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 10.41.55.23 dc1>: ConnectionShutdown('Connection to 10.41.55.24 is closed',), <Host: 10.41.55.25 dc1>: ConnectionShutdown('Connection to 10.41.55.23 is closed',), <Host: 10.41.55.24 dc1>: ConnectionShutdown('Connection to 10.41.55.25 is closed',)})

Even though I had put 10 Retries in place the query failed. I had a look at driver code but I could not figure out how to reinitialize the session inside Resultset. Anyone faced a similar issue?

Best Regards,
Bhuvan

Adam Holmberg

unread,
Jun 13, 2016, 5:37:32 PM6/13/16
to python-dr...@lists.datastax.com
If the connections are closed, the requests will fail NoHostAvailable even with retries.

You should not have to reinitialize Session. The driver attempts to reconnect in the background according to the reconnection policy. Your best bet would be to pause for some time at the application level before resuming the query.

Regards,
Adam Holmberg

--
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-u...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages