|
149 | 149 | open_with_absolute_path/3]).
|
150 | 150 | -export([obtain/0, obtain/1, release/0, release/1, transfer/1, transfer/2,
|
151 | 151 | set_limit/1, get_limit/0, info_keys/0, with_handle/1, with_handle/2,
|
152 |
| - info/0, info/1, clear_read_cache/0]). |
| 152 | + info/0, info/1, clear_read_cache/0, clear_process_read_cache/0]). |
153 | 153 | -export([ulimit/0]).
|
154 | 154 |
|
155 | 155 | -export([start_link/0, start_link/2, init/1, handle_call/3, handle_cast/2,
|
|
165 | 165 | -define(CLIENT_ETS_TABLE, file_handle_cache_client).
|
166 | 166 | -define(ELDERS_ETS_TABLE, file_handle_cache_elders).
|
167 | 167 |
|
168 |
| --include("rabbit.hrl"). % For #amqqueue record definition. |
169 |
| - |
170 | 168 | %%----------------------------------------------------------------------------
|
171 | 169 |
|
172 | 170 | -record(file,
|
@@ -601,35 +599,7 @@ info() -> info(?INFO_KEYS).
|
601 | 599 | info(Items) -> gen_server2:call(?SERVER, {info, Items}, infinity).
|
602 | 600 |
|
603 | 601 | clear_read_cache() ->
|
604 |
| - case application:get_env(rabbit, fhc_read_buffering) of |
605 |
| - {ok, true} -> |
606 |
| - gen_server2:cast(?SERVER, clear_read_cache), |
607 |
| - clear_vhost_read_cache(rabbit_vhost:list()); |
608 |
| - _ -> %% undefined or {ok, false} |
609 |
| - ok |
610 |
| - end. |
611 |
| - |
612 |
| -clear_vhost_read_cache([]) -> |
613 |
| - ok; |
614 |
| -clear_vhost_read_cache([VHost | Rest]) -> |
615 |
| - clear_queue_read_cache(rabbit_amqqueue:list(VHost)), |
616 |
| - clear_vhost_read_cache(Rest). |
617 |
| - |
618 |
| -clear_queue_read_cache([]) -> |
619 |
| - ok; |
620 |
| -clear_queue_read_cache([#amqqueue{pid = MPid, slave_pids = SPids} | Rest]) -> |
621 |
| - %% Limit the action to the current node. |
622 |
| - Pids = [P || P <- [MPid | SPids], node(P) =:= node()], |
623 |
| - %% This function is executed in the context of the backing queue |
624 |
| - %% process because the read buffer is stored in the process |
625 |
| - %% dictionary. |
626 |
| - Fun = fun(_, State) -> |
627 |
| - _ = clear_process_read_cache(), |
628 |
| - State |
629 |
| - end, |
630 |
| - [rabbit_amqqueue:run_backing_queue(Pid, rabbit_variable_queue, Fun) |
631 |
| - || Pid <- Pids], |
632 |
| - clear_queue_read_cache(Rest). |
| 602 | + gen_server2:cast(?SERVER, clear_read_cache). |
633 | 603 |
|
634 | 604 | clear_process_read_cache() ->
|
635 | 605 | [
|
|
0 commit comments