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(server): Sleep on socket IO errors #1450

Merged
merged 3 commits into from
Feb 26, 2018

Conversation

klausi
Copy link
Contributor

@klausi klausi commented Feb 24, 2018

Fixes #1358

This pull request introduces a new sleep_on_error configuration option. It is used to swallow IO errors when the Hyper server is accepting requests. That way developers do not have to worry about IO errors in case the server is under heavy load and runs out of available file descriptors. Better DoS protection.

  • Is sleep_on_error a good name? I copied that from https://github.com/tailhook/tk-listen
  • What should be the default value? Currently sleep_on_error is false for backwards compatibility and developers need to enable it. I would argue that Hyper should be secure by default and it should be set to true.

@seanmonstar seanmonstar merged commit 43e8ec4 into hyperium:master Feb 26, 2018
@seanmonstar
Copy link
Member

Great, I love it!

I agree it should probably be enabled by default, and maybe someone may want to be able to configure the duration too, but this is a great first step.

@klausi
Copy link
Contributor Author

klausi commented Mar 3, 2018

Oh, cool, this was merged fast! Sorry about the additional merge commit. I though you would use the squash merge method on Github and did not clean up the commits here. Will do that next time!

And a big thank you to @tailhook, I copied quite a bit of your code and docs!

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.

2 participants