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

Fixed negative netty sleep values. #713

Merged
merged 1 commit into from
Oct 23, 2013
Merged

Conversation

brndnmtthws
Copy link
Contributor

For some context, it seems that retries.get() occasionally returns negative values.

@@ -93,9 +93,11 @@ void reconnect() {
*/
private int getSleepTimeMs()
{
int sleepMs = base_sleep_ms * Math.max(1, random.nextInt(1 << retries.get()));
int sleepMs = base_sleep_ms * Math.max(1, Math.min(1, random.nextInt(1 << retries.get())));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have min() within max()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, I effed the patch. Good catch. I just updated the patch.

@anfeng
Copy link
Collaborator

anfeng commented Oct 18, 2013

+1

2 similar comments
@ptgoetz
Copy link
Collaborator

ptgoetz commented Oct 19, 2013

+1

@xumingming
Copy link
Collaborator

+1

@ptgoetz
Copy link
Collaborator

ptgoetz commented Oct 19, 2013

Tagged for 0.9.0

ptgoetz added a commit that referenced this pull request Oct 23, 2013
Fixed negative netty sleep values.
@ptgoetz ptgoetz merged commit 3985de7 into nathanmarz:master Oct 23, 2013
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.

4 participants