Shreyas arya

Generation

generate functionThu, 09 Feb 2023

When requests to Step Function fail, Workflow Service performs exponential backoff retries to notify Step Function service. Number of retries = 3 The total duration of all attempts doesn't exceed 10 seconds.

def exponentialBackoff(max_attempt_count, max_attempt_duration): count = 1 wait_time = 1 duration = 0 while count <= max_attempt_count and duration <= max_attempt_duration: print("Attempting to notify Step Function Service. Attempt number " + str(count)) count = count + 1 duration = duration + wait_time time.sleep(wait_time) wait_time = wait_time * 2 print(count) exponentialBackoff(10,15)

Questions about programming?Chat with your personal AI assistant