Skip to content

Ensure resources are cleaned up when connection socket is closed before Ranch handshake completes #1902

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

Merged
merged 2 commits into from
Feb 27, 2019

Conversation

lukebakken
Copy link
Collaborator

Fixes #1901

I'm not 100% sure this is the right way to clean up when ranch:recv_proxy_header but I think this makes sense.

Also see: https://groups.google.com/d/topic/rabbitmq-users/3HAMNDucUPI/discussion

@michaelklishin michaelklishin changed the title Ensure resources are cleaned up Ensure resources are cleaned up when connection socket is closed before Ranch handshake completes Feb 27, 2019
rabbit_log:error(Msg, [Error]),
% The following call will clean up resources then exit
_ = ranch:handshake(Ref),
exit({shutdown, failed_to_recv_proxy_header}).
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@michaelklishin I don't think that this line will be reached in a real {error, closed} situation as ranch:handshake should exit here. But, there's no harm in leaving this exit call in.

@michaelklishin michaelklishin merged commit 08bce61 into master Feb 27, 2019
@michaelklishin michaelklishin deleted the rabbitmq-server-1901 branch February 27, 2019 22:01
lukebakken pushed a commit that referenced this pull request Feb 27, 2019
Ensure resources are cleaned up when connection socket is closed before Ranch handshake completes

(cherry picked from commit 08bce61)
@lukebakken
Copy link
Collaborator Author

Backported to v3.7.x

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