Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor retry logic #578

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

awiddersheim
Copy link
Member

No description provided.

The function returns if the type is 'READ' so the else statment was not
really necessary.
The retry logic was a bit ugly. Much of it looked like a poor mans
exponential backoff so stole a function from Jordan Sissel and modified
it slightly to improve the implementation and reduce code duplication:

https://github.com/jordansissel/experiments/blob/master/randomcode/exponential-backoff.c

Many of the waits seemed arbitrary and unfortunately, do not line up
exactly when using an exponential backoff. These changes will retry
things more often and could increase the overall time in which things
wait before giving up on retrying but only by 5 seconds at the most.

The biggest add in time (5 seconds) is in SendMSG() which is used quite
heavily throughout the code so the additional few seconds could have
some impact but it is difficult to say how much. There hopefully should
be none but it's worth noting. Most of the code will actually call
SendMSG() twice should the first call not result in the message being
sent which means most things are able to wait a decently long time in
order to get their message sent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant