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 6, 2016
1 parent 1fddea3 commit a2f8376
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
# Handle env variables.
$environment_variables = merge($default_env_variables, $rabbitmq::environment_variables)

# Get ranch (socket acceptor pool) availability
$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 a2f8376

Please sign in to comment.