Closed Bug 1478700 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 12193 - [WIP] Extending the capabilities of the HTTP/2.0 server

Categories

(Testing :: web-platform-tests, enhancement, P4)

enhancement

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 12193 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/12193
Details from upstream follow.

David Heiberg <dheiberg@mozilla.com> wrote:
>  [WIP] Extending the capabilities of the HTTP/2.0 server
>  
>  Setting up this PR now to get some feedback on this. I have extended the functionality of the the H2 server by improving the multithreading aspect mostly. To summarise, when the `Http2WebTestRequestHandler` receives a frame on a new stream, it creates a thread for that stream specifically and uses a `Queue` to pass frames from the h2 handler to the individual stream handlers.  
>  
>  In the stream threads, when it receives a `RequestReceived` frame it creates a `H2Request` straight away along with a `H2Response` object and begins handling those in a new thread. This is because at this point there is enough information to begin parsing and checking for invalid requests, mostly giving the ability to check for invalid routes without needing to wait for Data frames (#7693). In the instance of POST requests where Data frames are expected, I set up an `os.pipe()` pair of file-like objects, and use this to write the data received in the stream handler to the `rfile` that the request handler will read POST data from. Reason for using `os.pipe()` is that it ended up being the most appropriate file-like object for the scenario, as other ones like `BytesIO` didn't provide the blocking and EOF characteristics in a way that allows me to leave the request handler side untouched.
>  
>  The main reason for this PR is to get some feedback about what the API should look like. In theory (tests to come), someone should currently be able to write a test where a handler can create frames using the H2 Connection object and write them. I want to add something where the handler could create bogus frames (HPACK encoding might make this tricky for headers) and write those. Please let me know what you think this might look like, and any other functionality that should be exposed.
>  
>  
>  TL;DR:
>  * Made multithreading more robust, and made it so each stream gets its
>  own thread
>  
>  * Requests start getting parsed immediately and do not wait for the
>  entire request to get there. This helps with 404 detection early on and
>  other use cases.
>  
>  * Created H2Request object
>  
>  * Implemented basic Push Promise functionality
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8e6a0981695b
[wpt PR 12193] - [WIP] Extending the capabilities of the HTTP/2.0 server, a=testonly
Result changes from PR not available.
https://hg.mozilla.org/mozilla-central/rev/8e6a0981695b
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.