You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a weird case where http & https works without problem. However, http2 compat does not.
In the case where I'm trying to do a PATCH, PUT or POST the request doesn't finish with http2. GET, HEAD and other "safe" methods work without problem.
Given that http2 compat should be mostly an in place replacement for http I believe this is a bug somewhere?
Just an FYI, but you can't do allowHTTP1 with createServer, only createSecureServer. Not sure if that's the culprit as I'm having trouble following exactly what's going wrong. Any more debugging info or a full-source that I can run to reproduce it would be helpful. Thanks!
Also browsers won't connect via http2 to a non-secure server.
Can you tell me a bit more about what's happening in the full case? How exactly is the comparison for http vs http2 being done — are you just swapping http2.createSecureServer for the equivalent http/https version or something more? How far does it get in the http2 version — does the proxied to server receive the data at all?
Would love to help (since it sounds like there might be a legitimate issue) but it's hard without insight into what your code is doing, especially since the reduced test case works for you.
Issue is definitely in http2 and I can reproduce it with a minimal test case involving pipe. Trying to find the root cause and will submit a PR when done. Thanks for the report @ronag.
@ronag I have a proposed patch in #15503. If you wouldn't mind testing it against your code, that would be absolutely amazing. I think my test case matches but it's possible there's also another issue at play.
Activity
ronag commentedon Sep 20, 2017
I've tried with master.
apapirovski commentedon Sep 20, 2017
Just an FYI, but you can't do
allowHTTP1withcreateServer, onlycreateSecureServer. Not sure if that's the culprit as I'm having trouble following exactly what's going wrong. Any more debugging info or a full-source that I can run to reproduce it would be helpful. Thanks!Also browsers won't connect via http2 to a non-secure server.
ronag commentedon Sep 20, 2017
@apapirovski: It's the same with
createSecureServer.ronag commentedon Sep 20, 2017
A full source is going to be difficult since there are quite a lot of components involved to get it fully working.
Have to think about how/if I can create a repo case you can run.
What kind of debugging info would be useful?
ronag commentedon Sep 20, 2017
Do you have an example of how to create a http2 file upload using a client in node?
apapirovski commentedon Sep 20, 2017
Yeah, for sure. This test has a fully working example: https://github.com/nodejs/node/blob/master/test/parallel/test-http2-client-upload.js
ronag commentedon Sep 20, 2017
@apapirovski: The minimal case seems to work. So basically:
Not sure where to go from here...
apapirovski commentedon Sep 20, 2017
Can you tell me a bit more about what's happening in the full case? How exactly is the comparison for http vs http2 being done — are you just swapping
http2.createSecureServerfor the equivalent http/https version or something more? How far does it get in the http2 version — does the proxied to server receive the data at all?Would love to help (since it sounds like there might be a legitimate issue) but it's hard without insight into what your code is doing, especially since the reduced test case works for you.
ronag commentedon Sep 20, 2017
I'm making a simple proxy that forwards http2 requests from Chrome to our backend storage server:
Currently, I simply switch from
http2tohttplike this:When I try to upload from Chrome the requests are stuck on "pending":
ronag commentedon Sep 20, 2017
Using nginx instead as http2->http1 proxy works. So I don't think it's a problem with the storage server.
We're trying to replace nginx with a minimal node alternative.
apapirovski commentedon Sep 20, 2017
I think I'm able to replicate the issue. Looking into it.
apapirovski commentedon Sep 20, 2017
Issue is definitely in
http2and I can reproduce it with a minimal test case involvingpipe. Trying to find the root cause and will submit a PR when done. Thanks for the report @ronag.teerapat1739 commentedon Sep 20, 2017
this same problem with me
apapirovski commentedon Sep 20, 2017
@ronag I have a proposed patch in #15503. If you wouldn't mind testing it against your code, that would be absolutely amazing. I think my test case matches but it's possible there's also another issue at play.
ronag commentedon Sep 21, 2017
@apapirovski: Yep, that fixes it!
http2: fix compat stream read handling, add tests
http2: fix compat stream read handling, add tests
http2: fix compat stream read handling, add tests
http2: fix compat stream read handling, add tests
http2: fix compat stream read handling, add tests