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
Convert ResourceVanished error to ConnectionClosedByPeer exception an… #795
Convert ResourceVanished error to ConnectionClosedByPeer exception an… #795
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me. @kazu-yamamoto can you give this a check as well?
544561e
to
1b3a92a
Compare
Hi @kazu-yamamoto, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry for the delay. I didn't notice this. I have merged this PR. |
It would be helpful to have a new release. |
@snoyberg This changed the behavior. Would you suggest a new version number? |
I don't think it's necessary
…On Wed, Apr 8, 2020, 3:29 AM Kazu Yamamoto ***@***.***> wrote:
@snoyberg <https://github.com/snoyberg> This changed the behavior. Would
you suggest a new version number?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#795 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMCBY3BEFIYFOMXJHY5NLRLPANZANCNFSM4K467U6Q>
.
|
@snoyberg Did you mean that 3.3.10 is good enough? |
Yes I think it's fine |
@snoyberg Thank you! |
3.3.10 has been released. |
Thank you everyone |
…d refine the catching
Hi everyone. At @typeable, we have a big web application, one of its components is a web API served by a warp+wai+servant server. Every request takes a lot of time to be resolved due to connections to multiple external interfaces. If I close the http client (for example killing curl or closing the browser),
warp
returns an error likeNetwork.Socket.sendBuf: resource vanished (Broken pipe)
.The reason is that the function
socketConnection
, in theNetwork.Wai.Handler.Warp.Run
module, calls thesendAll
function (from theNetwork.Socket.ByteString
module) but the remote http client has already closed the connection.I tried to create a simple example to reproduce this error, without success.
It might be related to #196 or some bad interactions between warp+wai and the servant application. I have to admit that I still don't know the reason.
Anyway, inspired by this old issue #421, I think it would be good to catch the
IOException
with error typeResourceVanished
and throw aConnectionClosedByPeer
, like has been done in theNetwork.Wai.Handler.WarpTLS
module.I also refined the exception catching for both the
warp
andwarp-tls
package like was suggested here 91d0546#r12752366.What do you think?