-
Notifications
You must be signed in to change notification settings - Fork 428
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
Fix ssl_closed message leak when server hangs up ("Connection: close" header) #640
base: master
Are you sure you want to change the base?
Conversation
* mutually recursive maybe_continue and async_recv functions are really tricky to reason about, but it doesn't seem like it makes sense for maybe_continue to do error handling at all, since async_recv was already doing it * maybe_continue and stream_loop shouldn't select socket messages * we're getting into a state where the socket sends us a message while we're doing other things and we do that receive and then crash * this change makes async_recv the only one to do a select for transport messages * When the server closes the connection and :ssl sends us :ssl_closed, we weren't handling the message, which caused it to leak into the mailbox even after the request was ended * need to flush to make sure it's gone in this case where the server hangs up * caused when Connection: close header is sent fix debugging statement
* bug i think appeared in 6ddc33c * when streaming the response, we terminate the parse recursive calls early since there is no match for {:more, {hparser, ...:on_trailers...}} case
@benoitc Hi, please why is it still not merged as a whole? I can see only second commit changes in 1.16.0...v1.17.0 probably cherry-picked? Thanks |
i didn't cherry-picked :) I merged your other PR #641 . I didn't merge this one yet as i wanted to test it first. There will be a new release next week that should fix the issue. |
Thanks for the reply. It wasn't my PR I just asked about it because we were facing same issue in our projects. |
Hello @benoitc, what is the current status on this PR?
Also is this referring to a 1.17.1 version coming soon? Because with 1.17.0 which mentions this PR, the issue still exists. Thank edit* I cloned the 1.17.0 master branch and cherry picked this PR and I can confirm that it solved the issue. |
Update: after 2 days of working properly without any issues, it started to throw the same error again. |
Sorry to have been silent. There is a new release coming next week that
will fix this issue. I will create a ticket summarizing it.
…On Mon 28 Dec 2020 at 16:56 Erik Mocny ***@***.***> wrote:
@benoitc <https://github.com/benoitc> Hi, please why is it still not
merged as a whole? I can see only second commit changes in
1.16.0...v1.17.0
<1.16.0...v1.17.0> probably
cherry-picked? Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#640 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADRIQMU6533TEVVYHWHXTSXCTCLANCNFSM4N4QYHCA>
.
|
@benoitc I'm trying the new version of hackney: 1.17.4 but it keeps the same behavior:
|
same issue here as well Erlang/OTP 22 [erts-10.7.2.7] here is the function implementation
|
We're seeing a whole bunch of [errors] in sentry related to an unhandled `{:ssl_closed, _info}` message. This was apparently [fixed] by a Hackney patch, but we're on latest and still experiencing the issue, so I guess not! [errors]: https://sentry.io/share/issue/207a371da909426aadf6658651b0ebc9/ [fixed]: benoitc/hackney#640
We're seeing a whole bunch of [errors] in sentry related to an unhandled `{:ssl_closed, _info}` message. This was apparently [fixed] by a Hackney patch, but we're on latest and still experiencing the issue, so I guess not! [errors]: https://sentry.io/share/issue/207a371da909426aadf6658651b0ebc9/ [fixed]: benoitc/hackney#640
This should fix #464
mutually recursive maybe_continue and async_recv
functions are really tricky to reason about, but
it doesn't seem like it makes sense for maybe_continue
to do error handling at all, since async_recv was already
doing it
socket messages
us a message while we're doing other things and
we do that receive and then crash
this change makes async_recv the only one to do
a select for transport messages
When the server closes the connection
and :ssl sends us :ssl_closed, we weren't
handling the message, which caused it to leak
into the mailbox even after the request was ended
where the server hangs up
fix debugging statement