summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bakken <luke@bakken.io>2017-11-01 17:00:07 -0700
committerLuke Bakken <luke@bakken.io>2017-11-01 17:00:07 -0700
commitbb608f437bd800d88cf6fbdb9018752662221c04 (patch)
tree607e7691dffb6932aae0d5f34aac049377a9a80d
parent67c9b9ce4f9e185baa89af0df7b11c8d8b1b8056 (diff)
parent27bf1d6869cba44122e595655a5c0d612152a3f4 (diff)
downloadrabbitmq-server-git-bb608f437bd800d88cf6fbdb9018752662221c04.tar.gz
Merge branch 'master' into rabbitmq-server-995
-rw-r--r--src/rabbit_networking.erl12
-rw-r--r--src/rabbit_vm.erl19
2 files changed, 16 insertions, 15 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index cd65841933..399b1143d3 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -328,10 +328,16 @@ emit_connection_info_local(Items, Ref, AggregatorPid) ->
connections_local()).
close_connection(Pid, Explanation) ->
- rabbit_log:info("Closing connection ~p because ~p~n", [Pid, Explanation]),
case lists:member(Pid, connections()) of
- true -> rabbit_reader:shutdown(Pid, Explanation);
- false -> throw({error, {not_a_connection_pid, Pid}})
+ true ->
+ Res = rabbit_reader:shutdown(Pid, Explanation),
+ rabbit_log:info("Closing connection ~p because ~p~n", [Pid, Explanation]),
+ Res;
+ false ->
+ rabbit_log:warning("Asked to close connection ~p (reason: ~p) "
+ "but no running cluster node reported it as an active connection. Was it already closed? ~n",
+ [Pid, Explanation]),
+ ok
end.
force_connection_event_refresh(Ref) ->
diff --git a/src/rabbit_vm.erl b/src/rabbit_vm.erl
index b2474a6b38..265bcb45e3 100644
--- a/src/rabbit_vm.erl
+++ b/src/rabbit_vm.erl
@@ -61,19 +61,11 @@ memory() ->
erlang:memory([total, processes, ets, atom, binary, code, system]),
Strategy = vm_memory_monitor:get_memory_calculation_strategy(),
- {Allocated, VMTotal} = case Strategy of
- erlang -> {ErlangTotal, ErlangTotal};
- allocated ->
- Alloc = recon_alloc:memory(allocated),
- {Alloc, Alloc};
- rss ->
- Alloc = recon_alloc:memory(allocated),
- Vm = vm_memory_monitor:get_process_memory(current),
- {Alloc, Vm}
- end,
+ Allocated = recon_alloc:memory(allocated),
+ Rss = vm_memory_monitor:get_rss_memory(),
AllocatedUnused = max(Allocated - ErlangTotal, 0),
- OSReserved = max(VMTotal - Allocated, 0),
+ OSReserved = max(Rss - Allocated, 0),
OtherProc = Processes
- ConnsReader - ConnsWriter - ConnsChannel - ConnsOther
@@ -112,7 +104,10 @@ memory() ->
{other_system, System - ETS - Bin - Code - Atom},
{allocated_unused, AllocatedUnused},
{reserved_unallocated, OSReserved},
- {total, VMTotal}
+ {strategy, Strategy},
+ {total, [{erlang, ErlangTotal},
+ {rss, Rss},
+ {allocated, Allocated}]}
].
%% [1] - erlang:memory(processes) can be less than the sum of its
%% parts. Rather than display something nonsensical, just silence any