Skip to content

Commit

Permalink
Reduce ObjectRetrierWraps logging noise during normal use
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkavanagh committed Jul 1, 2024
1 parent 08fa7c0 commit 76ea216
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions zaza/openstack/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def __call__(self, *args, **kwargs):
wait_so_far = 0
while True:
try:
log(f"Running {self}({args}, {kwargs})")
return obj(*args, **kwargs)
except Exception as e:
# if retry_exceptions is not None, or the type of the exception
Expand All @@ -160,16 +159,15 @@ def __call__(self, *args, **kwargs):
raise
retry += 1
if retry > num_retries:
log("ObjectRetrierWraps: {}: exceeded number of retries, "
"so erroring out" .format(str(obj)))
log("ObjectRetrierWraps: exceeded number of retries, "
"so erroring out")
raise e
log("ObjectRetrierWraps: {}: call failed: retrying in {} "
"seconds" .format(str(obj), wait))
log("ObjectRetrierWraps: call failed: retrying in {} "
"seconds" .format(wait))
time.sleep(wait)
wait_so_far += wait
if wait_so_far >= total_wait:
raise e
print('wait: ', wait, ' backoff:', backoff)
wait = wait * backoff
if wait > max_interval:
wait = max_interval
Expand Down

0 comments on commit 76ea216

Please sign in to comment.