exponential-backoff

FCM: Retry-after and exponential backoff

强颜欢笑 提交于 2021-01-28 07:04:21
问题 As I understand, when a message fails to be delivered, the Retry-After header is sometimes included in the response and sometimes not. But what happens if I first receives an error response with Retry-After included, resends the message and receives another error response but without Retry-After? I know I should use exponential backoff but how does that work when the previous waiting time was from the Retry-After header? Imagine this sequence of requests and responses: Request 1: No waiting

Exponential backoff with message order guarantee using spring-kafka

让人想犯罪 __ 提交于 2020-05-24 20:37:51
问题 I'm trying to implement a Spring Boot-based Kafka consumer that has some very strong message delivery guarentees, even in a case of an error. messages from a partition must be processed in order, if message processing fails, the consumption of the particular partition should be suspended, the processing should be retried with a backoff, until it succeeds. Our current implementation fulfills these requirements: @Bean public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer

Google JavaScript API: catching HTTP errors

落花浮王杯 提交于 2019-12-12 01:22:01
问题 Abraham's answer to Google Calendar API : "Backend Error" code 503 exactly describes my situation. I get 503s at random places when looping through code that creates or deletes calendar entries. However, I can't figure out how to follow the advice that he cites from Google, which is to catch the error and retry the transaction using exponential back off. The code below is a loop that puts 8 new events into my calendar. It randomly experiences 503 errors, which are thrown from the Google API

Attribute access on a decorated callable class

丶灬走出姿态 提交于 2019-12-08 05:15:54
问题 I have a callable class: class CallMeMaybe: __name__ = 'maybe' def __init__(self): self.n_calls = 0 def __call__(self): self.n_calls += 1 raise Exception That seems to work as advertised: >>> f = CallMeMaybe() >>> f.n_calls 0 >>> for i in range(7): ... try: ... f() ... except Exception: ... pass ... >>> f.n_calls 7 I want to decorate it with an exponential backoff: from backoff import on_exception, expo dec = on_exception(expo, Exception, max_tries=3, on_backoff=print) f = CallMeMaybe() f2 =

What is the benefit of using exponential backoff?

本秂侑毒 提交于 2019-12-03 15:54:24
问题 When the code is waiting for some condition in which delay time is not deterministic, it looks like many people choose to use exponential backoff, i.e. wait N seconds, check if the condition satisfies; if not, wait for 2N seconds, check the condition, etc. What is the benefit of this over checking in a constant/linearly increasing time span? 回答1: This is the behavior of TCP congestion control. If the network is extremely congested, effectively no traffic gets through. If every node waits for

What is the benefit of using exponential backoff?

拈花ヽ惹草 提交于 2019-12-03 06:12:46
When the code is waiting for some condition in which delay time is not deterministic, it looks like many people choose to use exponential backoff, i.e. wait N seconds, check if the condition satisfies; if not, wait for 2N seconds, check the condition, etc. What is the benefit of this over checking in a constant/linearly increasing time span? This is the behavior of TCP congestion control. If the network is extremely congested, effectively no traffic gets through. If every node waits for a constant time before checking, the traffic just for checking will continue to clog the network, and the