threefoldtech / rmb-rs

RMB implementation in rust
Apache License 2.0
3 stars 1 forks source link

Implementing exponential backoff error-handling strategy #63

Closed sameh-farouk closed 1 year ago

sameh-farouk commented 2 years ago

Related Issues:

57

Explanation: An exponential backoff algorithm retries requests exponentially, increasing the waiting time between retries up to a maximum backoff time.

1- Make a request to Remote RMB.

2- If the request fails, wait 100ms + random_number_milliseconds seconds and retry the request.

3- If the request fails, wait 200ms + random_number_milliseconds seconds and retry the request.

4- If the request fails, wait 400ms + random_number_milliseconds seconds and retry the request.

5- And so on, up to a maximum_backoff time.

6- Continue waiting and retrying up to some maximum number of retries (5 as RMB implementation), but do not increase the waiting period between retries.

initial waiting 100ms random_number_milliseconds is 0 to 150ms maximum_backoff is 3000ms

muhamadazmy commented 1 year ago

Close now as out of scoop (cleaning up) can be done later