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

Fixbug for Backoff when many attempts: "UnsupportedError: Unsupported operation: Infinity or NaN toInt" #188

Merged
merged 1 commit into from
May 6, 2021

Conversation

fzyzcjy
Copy link
Contributor

@fzyzcjy fzyzcjy commented May 6, 2021

Hi thanks for the lib! For the backoff, when jitter is nonzero and there are many many attempts, the following error occurs:

UnsupportedError: Unsupported operation: Infinity or NaN toInt
  File "double.dart", line 219, in _Double.toInt
  File "double.dart", line 183, in _Double.floor

caused by the line of var deviation = (rand * jitter * ms).floor();, because ms is Infinity and floor cannot be called on it.

Thus I propose a fix to it :)

@jumperchen jumperchen merged commit 224ed90 into rikulo:master May 6, 2021
@jumperchen
Copy link
Member

Thanks for the contribution.

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented May 6, 2021

You are welcome!

@fzyzcjy fzyzcjy deleted the patch-1 branch May 6, 2021 08:58
jumperchen added a commit that referenced this pull request May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants