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

Fix simultaneous reconnection handling and exponential reconnection interval #43

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

Conversation

jaunis
Copy link

@jaunis jaunis commented Jun 20, 2016

Hello,

I ran into an issue in which a 'close' and an 'error' event are fired simultaneously. Thus, 2 re-connections are launched at the same time, and the second removes the listeners positioned on the socket by the first one.
This causes errors raised by the newly created socket not to be caught.

In this pull request, I fix this issue by rejecting a reconnection request if another one is pending.

I also fix the exponential reconnection interval : it is now limited to five times the initial interval.

Regards

@jaunis jaunis changed the title Fix simultaneous reconnection handling Fix simultaneous reconnection handling and exponential reconnection interval Sep 12, 2016
@andrew-aladev andrew-aladev mentioned this pull request Oct 10, 2016
@andrew-aladev
Copy link

Please add a comment about Sigmoid function you used.

@andrew-aladev
Copy link

andrew-aladev commented Oct 10, 2016

Please use retry.pending or something similar instead of instance variable. It looks like @nucleardreamer is designed retry object for such usage.

- Move attribute pendingReconnect to the retry object
@jaunis
Copy link
Author

jaunis commented Oct 11, 2016

@andrew-aladev It's done

@nucleardreamer
Copy link
Member

Thanks for the commit @jaunis, and sorry about the radio silence. I will be able to review this later today

Jean Aunis added 3 commits November 4, 2016 09:35
- timeout is given in seconds
- additional security to avoid launching several reconnections simultaneously
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.

3 participants