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

Investigate 20-second-long test #2049

Closed
composerinteralia opened this issue Oct 23, 2019 · 0 comments · Fixed by #2072
Closed

Investigate 20-second-long test #2049

composerinteralia opened this issue Oct 23, 2019 · 0 comments · Fixed by #2072

Comments

@composerinteralia
Copy link
Contributor

As noted in a TODO, bundle exec m test/test_web_server.rb:67 takes over 20 seconds to finish. I ran into this same issue while working on adding SSL support to the control CLI as a followup to #2046.

I started to investigate this and noticed that in Server#process_client we end up setting close_socket = false, which leaves the socket open until it is closed in the reactor after the 20 second PERSISTENT_TIMEOUT.

I haven't looked into why that code exists or the right way to fix this, but when running this test with close_socket = true instead of close_socket = false it completes in under 1 second.

composerinteralia added a commit to composerinteralia/puma that referenced this issue Nov 11, 2019
[skip changelog]

Closes puma#2049

Before this commit, `test_trickle_attack` and
`test_file_streamed_request` were each taking an extra 20 seconds to run.

Without the `Connection: close` header, the [connection was kept
alive][keep alive] until it timed out after the
[`PERSISTENT_TIMEOUT`][PERSISTENT_TIMEOUT] duration of 20 seconds.

[keep alive]: https://github.com/puma/puma/blob/3835ac74dec5511d637cbc4ebc140c3b8632b447/lib/puma/server.rb#L706-L708
[PERSISTENT_TIMEOUT]: https://github.com/puma/puma/blob/3835ac74dec5511d637cbc4ebc140c3b8632b447/lib/puma/const.rb#L109-L111
composerinteralia added a commit to composerinteralia/puma that referenced this issue Nov 11, 2019
[skip changelog]

Closes puma#2049

Before this commit, `test_trickle_attack` and
`test_file_streamed_request` were each taking an extra 20 seconds to run.

Without the `Connection: close` header, the [connection was kept
alive][keep alive] until it timed out after the
[`PERSISTENT_TIMEOUT`][PERSISTENT_TIMEOUT] duration of 20 seconds.

[keep alive]: https://github.com/puma/puma/blob/3835ac74dec5511d637cbc4ebc140c3b8632b447/lib/puma/server.rb#L706-L708
[PERSISTENT_TIMEOUT]: https://github.com/puma/puma/blob/3835ac74dec5511d637cbc4ebc140c3b8632b447/lib/puma/const.rb#L109-L111
nateberkopec pushed a commit that referenced this issue Nov 11, 2019
[skip changelog]

Closes #2049

Before this commit, `test_trickle_attack` and
`test_file_streamed_request` were each taking an extra 20 seconds to run.

Without the `Connection: close` header, the [connection was kept
alive][keep alive] until it timed out after the
[`PERSISTENT_TIMEOUT`][PERSISTENT_TIMEOUT] duration of 20 seconds.

[keep alive]: https://github.com/puma/puma/blob/3835ac74dec5511d637cbc4ebc140c3b8632b447/lib/puma/server.rb#L706-L708
[PERSISTENT_TIMEOUT]: https://github.com/puma/puma/blob/3835ac74dec5511d637cbc4ebc140c3b8632b447/lib/puma/const.rb#L109-L111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants