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

Create http.Server with Read and Write timeouts #304

Merged
merged 2 commits into from
Jun 26, 2020

Conversation

stephen-soltesz
Copy link
Contributor

@stephen-soltesz stephen-soltesz commented Jun 26, 2020

This change fixes #293 and adds similar preventative timeouts to the ServeOnce servers used by NDT5 plain, ws, and wss measurements.

This change adds ReadTimeout and WriteTimeout to the http.Server used by the control channel for all NDT5 and NDT7 servers. The plain server control channel provides it's own timeout logic.

However, for singleserving servers, this change now adds a context timeout in the plainServer.ServeOnce logic and uses the same http.Server timeouts as the control ports for ws and wss servers.

Also fixes #122

For a summary of how http.Server timeouts apply to the connection lifetime, see:
https://blog.cloudflare.com/the-complete-guide-to-golang-net-http-timeouts/


This change is Reviewable

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 1385

  • 36 of 36 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 80.862%

Totals Coverage Status
Change from base Build 1375: 0.4%
Covered Lines: 1707
Relevant Lines: 2111

💛 - Coveralls

Copy link
Contributor

@pboothe pboothe left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @pboothe)

@stephen-soltesz stephen-soltesz merged commit 7e0ee25 into master Jun 26, 2020
@stephen-soltesz stephen-soltesz deleted the sandbox-soltesz-server-timeout branch June 26, 2020 17:11
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.

Apparent goroutine leak at dfw05 NDT legacy sockets need a timeout set
3 participants