Function
execute_with_retry_tolerant
(session, query, retry_exceptions, escape_exception)
Source from the content-addressed store, hash-verified
| 709 | |
| 710 | |
| 711 | def 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 | |
| 727 | def drop_keyspace_shutdown_cluster(keyspace_name, session, cluster): |
Callers
nothing calls this directly
Tested by
no test coverage detected