diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2017-03-07 10:06:26 +0000 |
|---|---|---|
| committer | Michael Klishin <mklishin@pivotal.io> | 2017-03-08 09:55:09 +0300 |
| commit | fcf04fbdf6d3f943254a1431f0d1e4c2d1745e17 (patch) | |
| tree | d75953ad7265512cc938e6a6bf25891188b4b427 /src | |
| parent | 1a7a5571ff369831b7af5ce2c24a4cf3d4e58fe1 (diff) | |
| download | rabbitmq-server-git-fcf04fbdf6d3f943254a1431f0d1e4c2d1745e17.tar.gz | |
Test and clean up metrics dependent on both process and entity
It leaked consumer_created when the queue still existed, now both
entity and process must exists to keep the metrics.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_core_metrics_gc.erl | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/rabbit_core_metrics_gc.erl b/src/rabbit_core_metrics_gc.erl index 99a8058bde..3141fdc301 100644 --- a/src/rabbit_core_metrics_gc.erl +++ b/src/rabbit_core_metrics_gc.erl @@ -64,7 +64,6 @@ gc_connections() -> gc_process(connection_coarse_metrics). gc_channels() -> - %% TODO channel stats gc_process(channel_created), gc_process(channel_metrics), gc_process(channel_process_metrics), @@ -107,7 +106,6 @@ gc_process(Pid, Table, Key) -> true -> none; false -> - %% TODO catch? ets:delete(Table, Key), none end. @@ -128,7 +126,6 @@ gc_entity(Id, Table, Key, GbSet) -> true -> none; false -> - %% TODO catch? ets:delete(Table, Key), none end. @@ -136,26 +133,22 @@ gc_entity(Id, Table, Key, GbSet) -> gc_process_and_entity(Table, GbSet) -> ets:foldl(fun({{Pid, Id} = Key, _, _, _, _, _, _, _}, none) when Table == channel_queue_metrics -> - gc_entity(Id, Table, Key, GbSet), - gc_process(Pid, Table, Key); + gc_process_and_entity(Id, Pid, Table, Key, GbSet); ({{Pid, Id} = Key, _, _, _, _}, none) when Table == channel_exchange_metrics -> - gc_entity(Id, Table, Key, GbSet), - gc_process(Pid, Table, Key); + gc_process_and_entity(Id, Pid, Table, Key, GbSet); ({{Id, Pid, _} = Key, _, _, _, _}, none) when Table == consumer_created -> - gc_entity(Id, Table, Key, GbSet), - gc_process(Pid, Table, Key); + gc_process_and_entity(Id, Pid, Table, Key, GbSet); ({{{Pid, Id}, _} = Key, _, _, _, _}, none) -> gc_process_and_entity(Id, Pid, Table, Key, GbSet) end, none, Table). gc_process_and_entity(Id, Pid, Table, Key, GbSet) -> - case rabbit_misc:is_process_alive(Pid) orelse gb_sets:is_member(Id, GbSet) of + case rabbit_misc:is_process_alive(Pid) andalso gb_sets:is_member(Id, GbSet) of true -> none; false -> - %% TODO catch? ets:delete(Table, Key), none end. |
