MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / execute_with_retry_tolerant

Function execute_with_retry_tolerant

tests/integration/__init__.py:711–724  ·  view source on GitHub ↗
(session, query, retry_exceptions, escape_exception)

Source from the content-addressed store, hash-verified

709
710
711def execute_with_retry_tolerant(session, query, retry_exceptions, escape_exception):
712 # TODO refactor above methods into this one for code reuse
713 tries = 0
714 while tries < 100:
715 try:
716 tries += 1
717 rs = session.execute(query)
718 return rs
719 except escape_exception:
720 return
721 except retry_exceptions:
722 time.sleep(.1)
723
724 raise RuntimeError("Failed to execute query after 100 attempts: {0}".format(query))
725
726
727def drop_keyspace_shutdown_cluster(keyspace_name, session, cluster):

Callers

nothing calls this directly

Calls 2

sleepMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected