Skip to content

Commit df1fc59

Browse files
committed
policies.py: Remove max reconnect attempts
This was kept this way to preserve legacy behavior, but this behavior is absurd and hurtful. We need to get rid of it now.
1 parent d83adab commit df1fc59

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

cassandra/policies.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ class ConstantReconnectionPolicy(ReconnectionPolicy):
773773
in-between each reconnection attempt.
774774
"""
775775

776-
def __init__(self, delay, max_attempts=64):
776+
def __init__(self, delay, max_attempts=None):
777777
"""
778778
`delay` should be a floating point number of seconds to wait in-between
779779
each attempt.
@@ -807,10 +807,7 @@ class ExponentialReconnectionPolicy(ReconnectionPolicy):
807807
trying to reconnect at exactly the same time.
808808
"""
809809

810-
# TODO: max_attempts is 64 to preserve legacy default behavior
811-
# consider changing to None in major release to prevent the policy
812-
# giving up forever
813-
def __init__(self, base_delay, max_delay, max_attempts=64):
810+
def __init__(self, base_delay, max_delay, max_attempts=None):
814811
"""
815812
`base_delay` and `max_delay` should be in floating point units of
816813
seconds.

0 commit comments

Comments
 (0)