Skip to content

Commit

Permalink
Cleanup void tcp options
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mpolenchuk committed May 12, 2016
1 parent 39d0fdf commit ea2303f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
14 changes: 8 additions & 6 deletions templates/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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' -%>
Expand Down

0 comments on commit ea2303f

Please sign in to comment.