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

Avoid undefined in client #146

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FinleyMcIlwaine
Copy link
Collaborator

Instead of raceing the background threads and the client, we run them concurrently and check which finishes first. If the background threads finished first, we wait for the client. If the client finished first, we cancel the background threads and return.

@kazu-yamamoto we also added a case in sendGoAway in Network.HTTP2.H2.Receiver so that GoAwayIsSent is handled the same as ConnectionIsClosed, which appears to more closely match the behavior of the frame sender. Also, previously if GoAwayIsSent happened, it would be wrapped in a BadThingHappen which would cause the frame sender to rethrow it. Does this change seem acceptable to you?

Also, this does not communicate the stream id from a GOAWAY to the client if the background threads finish first, but feel free to extend this PR to add that!

@FinleyMcIlwaine
Copy link
Collaborator Author

This solves #139, but uncovered some other uncaught exception output coming from tls in our stress tests of grapesy. That output was eliminated with this patch to tls haskell-tls/hs-tls#477

Copy link
Owner

@kazu-yamamoto kazu-yamamoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks excellent.
I will revisit your concerns when I merge my current work after merging this PR.

kazu-yamamoto added a commit that referenced this pull request Sep 18, 2024
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.

2 participants