Closed akshaymankar closed 2 weeks ago
This also results in "ConnectionIsClosed" being printed to stdout constantly in my servant (warp, warp-tls) server setup.
Sorry. I did not notice this issue.
Is threadDelay
before throwIO
good enough?
@akshaymankar @wilfreddenton Gentle ping.
Hey so I solved my problem by adding a custom exception handler to my warp server that logs any exceptions bubbling up that far instead of printing them to stdout. So I don't have any strong recommendations in regards to how to proceed with this issue.
For me though, and this is without any contextual knowledge, it seems weird that there is a check for the existence of an error and, when it doesn't exist, this exception gets thrown. I'm assuming this is done because you want calling threads to be able to catch and handle the closing of a connection. Maybe exceptions aren't the right abstraction for this though?
Yeah, I also think exception is not the right way to communicate graceful closing of the connection. The threadDelay
is also a bit hopeful in terms of a response being served and consumed in a given amount of time.
The purpose of the exception is to break cocurrently_
of the async
package.
I understand this issue deeply now. I will try to think how to fix this issue.
This should be fixed in the current main
.
When GOAWAY is received, Receiver
waits until all workers are finished and sends CFinish
to Sender
.
From Section about GOAWAY in the spec:
Here the Receiver just throws an exception when it receives a
GOAWAY
and so the response can never be recieved:https://github.com/kazu-yamamoto/http2/blob/07af719d98da6edb30ef818a93b5fce15368329b/Network/HTTP2/H2/Receiver.hs#L335-L339