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

INDY-1431: add listener bind retries. #838

Merged
merged 1 commit into from
Jul 26, 2018

Conversation

sergey-shilov
Copy link
Contributor

Signed-off-by: Sergey Shilov sergey.shilov@dsr-company.com

Signed-off-by: Sergey Shilov <sergey.shilov@dsr-company.com>
@@ -90,7 +90,6 @@ def handle_listener_events(self):
def restart(self):
logger.warning("Stopping client stack on node {}".format(self))
self.stop()
time.sleep(0.2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need this timeout anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This time out has gone to binding cycle if it is needed (i.e. busy port).

Copy link
Contributor

Choose a reason for hiding this comment

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

But I was thinking that this timeout was added with a different purpose, to have a chance for sockets to be closed, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, connection sockets are not closed during TIME_WAIT (~2 mins). This time out was added just for sure that the kernel freed listener socket structure. But our tests under syn flood shows that it is not enough. So I've implemented a logic to have more chances to re-bind in case of immediate stack restart.

@ashcherbakov ashcherbakov merged commit e13779c into hyperledger:master Jul 26, 2018
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