-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 request buffering for HTTP/2.0 #10204
Conversation
Thanks @PidgeyBE! This is nice! |
@PidgeyBE how are you testing that this works? Could you perhaps add a test for this on the PR? |
@kikito Google Chrome uses HTTP/2.0 by default, so although we instructed Kong to turn off request buffering on that route, it didn't help. I'm currently on holiday with no PC access, but I can add a test next week! Would be nice if you could link me to the best place to add this test! |
@kikito I checked the code and assume testing happens here https://github.com/Kong/kong/blob/master/spec/02-integration/05-proxy/27-unbuffered_spec.lua . |
@PidgeyBE Could you enable the option with your patch and manually test this with a HTTP/2 compliant client (like |
@dndx Yes, that's how I've tested it, in addition to testing via Google Chrome, which also defaults to HTTP/2.0. Do you want me to repeat the test and make a video somehow? |
Generally, we encourage adding automated tests for every PR. If possible, we should let CI run the test for every new coming PRs after the fix is applied. |
@StarlightIbuki Yes of course! The issue is the current test framework does not support HTTP/2.0. So the only thing I can test in CI is if HTTP/1.1 still works. The feature I adapted already had tests for HTTP/1.1 and these still work. |
Thank you for reminding me of this. We will be discussing http2 support for test. |
There is That is the You can see it in action here: @PidgeyBE could you try that? |
@bungle Yes sure!
As alternative I tried https://github.com/Kong/kong-build-tools; and followed all steps, but it's also failing at different points. (e.g. prebuild docker images not available, missing flags for buildx, etc.. ) //edit: I've found out about
because I got an error
|
@bungle I'm trying to add tests for HTTP/2.0. |
@PidgeyBE the You can check the output of |
@dndx Ok 😬 |
Dear @dndx @bungle The tests I made work for both HTTP/1.1 and HTTP/2.0 and I can run them locally, with success.
If I run the same tests on master branch (where the fix this PR is about is not present), the tests for HTTP/2.0 fail (as expected). If you guys have some early feedback or approve these tests, let me know! 🙏 |
Alright, I've merged the tests! 👌 |
6290381
to
b4e5390
Compare
753b241
to
ef0a162
Compare
ef0a162
to
9d2589f
Compare
some of the ci things still bothers me, I will try something on my own
Co-authored-by: Aapo Talvensaari <[email protected]>
Co-authored-by: Aapo Talvensaari <[email protected]>
@PidgeyBE one last ask, can you rebase this to latest master, and le's run the test suite once more (I'll hit run in a morning my time). I think I am going to merge this tomorrow. I tried to tests working with I also tried the https://github.com/tokers/lua-resty-http2 with a slightly better success, but couldn't yet figure out how to write the code so that I can send more than 64kB (seems to require lower level APIs for that). So both kinda dead-ends and your solution using Lua cURL feels the best. |
This reverts commit 51cfcfb.
### Summary Turning request/response buffering off for HTTP/2.0 is not possible. There is a check that causes buffering only to be controllable for HTTP/1.1. This was probably done because of an issue in nginx, which was fixed in version 1.9.14 (http://nginx.org/en/docs/http/ngx_http_v2_module.html): > Before version 1.9.14, buffering of a client request body could not be > disabled regardless of [proxy_request_buffering](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_request_buffering), > [fastcgi_request_buffering](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_request_buffering), > [uwsgi_request_buffering](http://nginx.org/en/docs/http/ngx_http_uwsgi_module.html#uwsgi_request_buffering), and > [scgi_request_buffering](http://nginx.org/en/docs/http/ngx_http_scgi_module.html#scgi_request_buffering) directive values. Kong now has Nginx > 1.9.14, so the check is not needed any more. The work was done by @PidgeyBE, thank you very much! ### Issues Resolved Fix #7418 Close #10204 Signed-off-by: Aapo Talvensaari <[email protected]>
### Summary Turning request/response buffering off for HTTP/2.0 is not possible. There is a check that causes buffering only to be controllable for HTTP/1.1. This was probably done because of an issue in nginx, which was fixed in version 1.9.14 (http://nginx.org/en/docs/http/ngx_http_v2_module.html): > Before version 1.9.14, buffering of a client request body could not be > disabled regardless of [proxy_request_buffering](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_request_buffering), > [fastcgi_request_buffering](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_request_buffering), > [uwsgi_request_buffering](http://nginx.org/en/docs/http/ngx_http_uwsgi_module.html#uwsgi_request_buffering), and > [scgi_request_buffering](http://nginx.org/en/docs/http/ngx_http_scgi_module.html#scgi_request_buffering) directive values. Kong now has Nginx > 1.9.14, so the check is not needed any more. The work was done by @PidgeyBE, thank you very much! ### Issues Resolved Fix #7418 Close #10204 Signed-off-by: Aapo Talvensaari <[email protected]> Co-authored-by: PidgeyBE <[email protected]>
Indeed! I more or less traveled the same path 👍 |
Summary
Turning request/response buffering off for HTTP/2.0 is not possible.
There is a check that causes buffering only to be controllable for HTTP/1.1. This was probably done because of an issue in nginx, which was fixed in version 1.9.14 (http://nginx.org/en/docs/http/ngx_http_v2_module.html)
Kong 3.1.1 has nginx > 1.9.14, so the check is not needed any more.
Checklist
Issue reference
Fix #7418