-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Replace TCP acceptor pool with Ranch #260
Comments
The acceptor pools are quite similar. Configuration is basically the same (Ranch is filtering out a few options, like SSL's depth option or TCP's exit_on_close option, but adding those to Ranch is trivial). Concepts of listener and acceptors are very similar, it should be fairly straightforward to replace them. The supervision tree for connections in RabbitMQ is a bit complex but I don't think it would be a problem. The ranch_conns_sup supervisor would become rabbit_tcp_client_sup (registered name) handled by rabbit_client_sup module. The difference would be mainly that ranch_conns_sup is a custom supervisor, while rabbit_client_sup is supervisor2. The supervision tree would otherwise stay unchanged. I estimate this would take about two days to get something up and running, and probably some time after that to resolve unforeseen issues. |
Why does Ranch filter out TLS depth? It is for sure used by some of our users. |
Rather a correct wording would be: Ranch validates options (and sets some required defaults at the same time) and the list of allowed options was done on a use case basis. So if depth isn't there yet, it's that no Ranch user has ever used it. :-) But it's a two lines patch to add options so it won't take me long. |
@essen excellent, then lets make sure we extend Ranch to accept all |
Alright. |
OK putting some notes here mostly so I don't forget things:
It'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. Doing the integration first, options can be added to Ranch when everything else starts working. |
ninenines/ranch#117, ninenines/ranch#121 and ninenines/ranch#122 are required changes for this ticket to be resolved, though neither will prevent me from finishing the proof of concept. |
The branch: https://github.com/rabbitmq/rabbitmq-server/tree/rabbitmq-server-260 The current WIP commit: ad9753a |
No changes needed in Ranch, but need to make sure we still do this in RabbitMQ itself. |
|
Damn I meant Ranch's 122, sorry for the spam. :-) |
Branch has been updated and works against current Ranch master but there's still work to do. :-) |
Most recent commit is 89a51ca. A few more things left to do, tests to be tested and then integrating that in the build properly. |
Pushed another update in 23421ec. I'm at the point where I did everything I could do on my own and I'll need help to integrate in the build system to finish. There's also an open ended question in the diff that will involve questions or investigation (search for "todo" if curious). |
For future reference: I will also need to update the AMQP 1.0 plugin when the time comes (stumbled upon a compile issue while doing other things). |
I did some fairly extensive testing and none of the minor regressions I could find were Ranch related. Thank you, @essen! |
Woo!! |
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: rabbitmq/rabbitmq-server#260
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.
The text was updated successfully, but these errors were encountered: