From ea2303fa5bf806209b1595ae28569186c5588a0c Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Wed, 11 May 2016 14:08:02 +0300 Subject: [PATCH] Cleanup void tcp options After Ranch (socket acceptor pool) has come into effect the following tcp listen options is no longer valid: - binary, packet, reuseaddr. For details: https://github.com/rabbitmq/rabbitmq-server/issues/260 --- manifests/config.pp | 4 ++++ templates/rabbitmq.config.erb | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 064c9dbde..bc863b085 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -67,6 +67,10 @@ # Handle env variables. $environment_variables = merge($default_env_variables, $rabbitmq::environment_variables) + # Get ranch (socket acceptor pool) availability, + # use init class variable for that since version from the fact comes too late. + $ranch = versioncmp($rabbitmq::version, '3.6') >= 0 + file { '/etc/rabbitmq': ensure => directory, owner => '0', diff --git a/templates/rabbitmq.config.erb b/templates/rabbitmq.config.erb index bece53494..bc1536436 100644 --- a/templates/rabbitmq.config.erb +++ b/templates/rabbitmq.config.erb @@ -17,17 +17,19 @@ {cluster_nodes, {[<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}}, {cluster_partition_handling, <%= @cluster_partition_handling %>}, <% end -%> - {tcp_listen_options, - [binary, + {tcp_listen_options, [ + <%- unless @ranch -%> + binary, + {packet, raw}, + {reuseaddr, true}, + <%- end -%> <%- if @tcp_keepalive -%> {keepalive, true}, <%- end -%> - {packet, raw}, - {reuseaddr, true}, {backlog, 128}, {nodelay, true}, - {exit_on_close, false}] - }, + {exit_on_close, false} + ]}, <%- if @ssl_only -%> {tcp_listeners, []}, <%- elsif @interface != 'UNSET' -%>