Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

changed reconnect from milliseconds to seconds, improved reconnect attempt#252

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

changed reconnect from milliseconds to seconds, improved reconnect attempt#252
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 1, 2015

I changed the reconnect delay from milliseconds to seconds. The builder form label changed to "seconds" and the client now multiplies the reconnect delay by 1000 to convert it to milliseconds. I modified the defaults for debug to be 1 second and for production to be 300 seconds, or 5 minutes. The previous value of 5 seconds created a much too obvious rapidly polling outgoing connection.

Additionally I modified the randomness in the reconnect timeout to always be between 50% and 150% of the configured value, allowing for a better randomly staggered reconnect time that is less likely to show up as a simple recurring pattern. If you use the 5 minute default that I set then the retry time will be between 2.5 minutes and 7.5 minutes.

@DragonzMaster
Copy link
Copy Markdown
Contributor

I really appreciate that you tried to do something good (in your opinion) but unfortunately I don't agree with these changes
But It is @MaxXor decision 😄

@yankejustin
Copy link
Copy Markdown
Contributor

@DragonzMaster Be sure to always give constructive criticism.


@DavesPlanet Just a question about the RELEASE config. setting:

Code Logic

Please correct my mistakes
Start with a 300 ms delay for reconnecting (you now changed ms to seconds, so we now have a 300 second delay).
We now can have a maximum of ((300 * 1000 + 300 * 1000) / 2) seconds of a delay wait timer.
The result is up a 300,000 second reconnect delay timer. This amounts to 5,000 hours, or 208 ⅓ days. Correct?

@yankejustin
Copy link
Copy Markdown
Contributor

I truthfully like the milliseconds unit. My reasons would be that it is consistent with the rest of the code, and also because we will normally dealing with seconds that may have more accuracy to them. Though it will likely get up to a few seconds, we normally will be dealing with fractions of a second. :)

@DragonzMaster
Copy link
Copy Markdown
Contributor

OK I will the next time, Sorry 😄 @yankejustin

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 5, 2015

@yankejustin sorry I missed your question. Your math is mixing scale, you have 300,000 milliseconds, not seconds.

The connection retry times should honestly never be as fast as a few seconds, they show up too easily on scanners. Even once per 60 seconds is still much too fast.

I did not hear anyone make an argument for setting the connection retry time to less than 1 second, which is the only reason for millisecond precision, and milliseconds just make the values intuitive for the user, nobody whats to put count zeros to make sure 300000 is the right value.

@MaxXor
Copy link
Copy Markdown
Contributor

MaxXor commented Aug 2, 2015

We'll keep it at milliseconds.

@MaxXor MaxXor closed this Aug 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants