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

Prepare for new http2 architecture #183

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Conversation

edsko
Copy link
Collaborator

@edsko edsko commented Jul 4, 2024

@edsko
Copy link
Collaborator Author

edsko commented Jul 4, 2024

The tests currently fail.

@edsko
Copy link
Collaborator Author

edsko commented Jul 4, 2024

client \ server old http2 new http2
old http2
new http2

So it seems something goes wrong server-side.

@edsko
Copy link
Collaborator Author

edsko commented Jul 4, 2024

Server running old http2 up to (including) the black marked packet, server running new http2 after that (client running old http2):

image

The client can connect, the server even responds with HTTP 200 and the gRPC headers, but then the client is left waiting for the rest of the response.

@FinleyMcIlwaine
Copy link
Collaborator

The server is hanging in waitForOutbound called from outboundTrailersMaker, which is called from http2 in fillDataHeaderEnqueueNext. The change in behavior seems to be that http2 is somehow constructing the trailers before grapesy is able to mark the outbound thread as done.

@kazu-yamamoto
Copy link

waitForOutbound calls waitForNormalThreadTermination.
Which thread does waitForNormalThreadTermination` wait for?

@kazu-yamamoto
Copy link

kazu-yamamoto commented Jul 11, 2024

I guess that the thread forked at https://github.com/well-typed/grapesy/blob/main/util/Network/GRPC/Util/Session/Server.hs#L72 does not terminate since respond terminates when the stream is finished in the new architecture.

The old worker just enqueues Response to the output queue and returns quickly
But the new worker collaborates with the sender after enqueuing Response and finishes when all data are sent.

@FinleyMcIlwaine FinleyMcIlwaine force-pushed the edsko/new-http2-architecture branch 3 times, most recently from 033b578 to 7001382 Compare July 11, 2024 17:59
@edsko
Copy link
Collaborator Author

edsko commented Jul 11, 2024

Locally tested 1000 withoutExceptions and 10,000 withExceptions tests, all passed ✔️ @FinleyMcIlwaine did the same.

This also enables `TCP_NODELAY` by default, and overrides the ping rate limit
(default to 100).

Co-authored-by: Finley McIlwaine <[email protected]>
@edsko
Copy link
Collaborator Author

edsko commented Jul 17, 2024

Have opened #190 to track #184 (comment) .

@edsko edsko marked this pull request as ready for review July 17, 2024 11:51
@edsko edsko merged commit bcb47e5 into main Jul 17, 2024
12 checks passed
@edsko edsko deleted the edsko/new-http2-architecture branch July 17, 2024 12:06
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.

3 participants