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

Fix for leaked pipes #54

Merged
merged 1 commit into from
Apr 17, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/conduit_async_ssl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ let ssl_listen ~crt_file ~key_file rd wr =
>>= fun app_rd ->
Copy link
Member

Choose a reason for hiding this comment

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

Not being that familiar with the code of conduit I'm wondering if it's possible for net_to_ssl to be closed before your cleanup call is made. E.g. after the app_rd is created but before app_wr. Admittedly, that's a little contrived.

Copy link
Author

Choose a reason for hiding this comment

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

@rgrinberg I don't know either. I am eager to hear from a core committer about this.

Copy link
Member

Choose a reason for hiding this comment

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

As the core committer, I'm not much more help -- the Async_ssl interface is terribly documented. Am reading the source code now...

Copy link
Member

Choose a reason for hiding this comment

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

I've tried your patch for 10 minutes with a curl running against cohttp lib_test/test_net_async_server.native, and there's no observable memory leak from a lot of https:// connections with this patch. So merging this...

Writer.of_pipe (Info.of_string "async_conduit_ssl_writer") app_wr
>>| fun (app_wr,_) ->
(* Close the pipes we created for ssl when we're done! *)
don't_wait_for (
Pipe.closed net_to_ssl >>= fun () ->
Deferred.all_ignore [Writer.close app_wr; Reader.close app_rd]
);
app_rd, app_wr