{"action":"created","issue":{"url":"https://api.github.com/repos/rabbitmq/rabbitmq-server/issues/260","labels_url":"https://api.github.com/repos/rabbitmq/rabbitmq-server/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/rabbitmq/rabbitmq-server/issues/260/comments","events_url":"https://api.github.com/repos/rabbitmq/rabbitmq-server/issues/260/events","html_url":"https://github.com/rabbitmq/rabbitmq-server/issues/260","id":100092939,"number":260,"title":"Replace TCP acceptor pool with Ranch","user":{"login":"essen","id":141739,"avatar_url":"https://avatars.githubusercontent.com/u/141739?v=3","gravatar_id":"","url":"https://api.github.com/users/essen","html_url":"https://github.com/essen","followers_url":"https://api.github.com/users/essen/followers","following_url":"https://api.github.com/users/essen/following{/other_user}","gists_url":"https://api.github.com/users/essen/gists{/gist_id}","starred_url":"https://api.github.com/users/essen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/essen/subscriptions","organizations_url":"https://api.github.com/users/essen/orgs","repos_url":"https://api.github.com/users/essen/repos","events_url":"https://api.github.com/users/essen/events{/privacy}","received_events_url":"https://api.github.com/users/essen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"essen","id":141739,"avatar_url":"https://avatars.githubusercontent.com/u/141739?v=3","gravatar_id":"","url":"https://api.github.com/users/essen","html_url":"https://github.com/essen","followers_url":"https://api.github.com/users/essen/followers","following_url":"https://api.github.com/users/essen/following{/other_user}","gists_url":"https://api.github.com/users/essen/gists{/gist_id}","starred_url":"https://api.github.com/users/essen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/essen/subscriptions","organizations_url":"https://api.github.com/users/essen/orgs","repos_url":"https://api.github.com/users/essen/repos","events_url":"https://api.github.com/users/essen/events{/privacy}","received_events_url":"https://api.github.com/users/essen/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-08-10T15:22:08Z","updated_at":"2015-08-12T11:24:12Z","closed_at":null,"body":"We are currently investigating how feasible it would be to just use Ranch for handling connections. Depending on the results of this investigation, the custom acceptor pool would be dropped and Ranch used directly. _Our key goal is to not have to maintain our own library, but we have to stay compatible w.r.t. network-related configuration._"},"comment":{"url":"https://api.github.com/repos/rabbitmq/rabbitmq-server/issues/comments/130265065","html_url":"https://github.com/rabbitmq/rabbitmq-server/issues/260#issuecomment-130265065","issue_url":"https://api.github.com/repos/rabbitmq/rabbitmq-server/issues/260","id":130265065,"user":{"login":"essen","id":141739,"avatar_url":"https://avatars.githubusercontent.com/u/141739?v=3","gravatar_id":"","url":"https://api.github.com/users/essen","html_url":"https://github.com/essen","followers_url":"https://api.github.com/users/essen/followers","following_url":"https://api.github.com/users/essen/following{/other_user}","gists_url":"https://api.github.com/users/essen/gists{/gist_id}","starred_url":"https://api.github.com/users/essen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/essen/subscriptions","organizations_url":"https://api.github.com/users/essen/orgs","repos_url":"https://api.github.com/users/essen/repos","events_url":"https://api.github.com/users/essen/events{/privacy}","received_events_url":"https://api.github.com/users/essen/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T11:24:12Z","updated_at":"2015-08-12T11:24:12Z","body":"OK putting some notes here mostly so I don't forget things:\r\n\r\n* [ ] Ranch is missing some TCP and SSL options\r\n* [ ] Ranch does not support callbacks for oninit and onterminate; _we do not need to add those_, we can just keep the tcp_listener process and let it do the callback handling like it does today\r\n* [ ] When starting the listener, use ranch:child_spec instead of what we currently do; put the Ranch child spec side by side with tcp_listener, and start them in that order; put them under tcp_listener_sup\r\n* [ ] Make sure rabbit_tcp_client_sup starts *before* the listeners (this is already the case, just a remainder); we need it to stop *after* the listeners on shutdown (see below)\r\n* [ ] The reader process will be supervised by the ranch part of the supervision tree (but still under the rabbit application)\r\n* [ ] The connection related processes (queue, apparently 2 hearbeat processes and the channel_sup_sup) can still sit under rabbit_connection_sup; however rabbit_connection_helper_sup is not needed anymore\r\n* [ ] Link the reader process and the rabbit_connection_sup process so that they both die together (basically simulating what having them under the rabbit_connection_sup supervisor would do)\r\n\r\nIt's interesting that the process that is supervised and the process that receives ownership of the socket are not the same. I will open a ticket about that and think about it for Ranch 2. We can then later on have everything in a proper supervision tree (not needing rabbit_tcp_client_sup anymore either). In the meantime, we need to use the link trick to have the same behavior as we had previously.\r\n\r\nDoing the integration first, options can be added to Ranch when everything else starts working.\r\n"}}