Skip to content

Commit 296b665

Browse files
Resolve a conflict (#8812)
1 parent 5749615 commit 296b665

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

deps/rabbit/src/rabbit_msg_store.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ client_read2(false, _Right,
593593
%% It's entirely possible that everything we're doing from here on
594594
%% is for the wrong file, or a non-existent file, as a GC may have
595595
%% finished.
596-
safe_ets_update_counter(
596+
rabbit_misc:safe_ets_update_counter(
597597
FileSummaryEts, File, {#file_summary.readers, +1},
598598
fun (_) -> client_read3(MsgLocation, Defer, CState) end,
599599
fun () -> read(MsgId, CState) end).

deps/rabbit_common/src/file_handle_cache_stats.erl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
%% stats about read / write operations that go through the fhc.
1111

12-
-export([init/0, update/3, update/2, update/1, get/0]).
12+
-export([init/0, update/3, update/2, update/1, get/0, inc/2]).
1313

1414
-define(TABLE, ?MODULE).
1515

@@ -48,13 +48,10 @@ update(Op) ->
4848
_ = safe_ets_update_counter(?TABLE, {Op, count}, 1),
4949
ok.
5050

51-
<<<<<<< HEAD
52-
=======
5351
inc(Op, Count) ->
5452
_ = safe_ets_update_counter(?TABLE, {Op, count}, Count),
5553
ok.
5654

57-
>>>>>>> d5d8689f54 (FHC: use safe versions of ets update functions)
5855
get() ->
5956
lists:sort(ets:tab2list(?TABLE)).
6057

deps/rabbit_common/src/rabbit_misc.erl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@
7979
-export([raw_read_file/1]).
8080
-export([find_child/2]).
8181
-export([is_regular_file/1]).
82-
<<<<<<< HEAD
83-
=======
8482
-export([maps_any/2]).
8583
-export([safe_ets_update_counter/3, safe_ets_update_counter/4, safe_ets_update_counter/5,
8684
safe_ets_update_element/3, safe_ets_update_element/4, safe_ets_update_element/5]).
87-
>>>>>>> d5d8689f54 (FHC: use safe versions of ets update functions)
8885

8986
%% Horrible macro to use in guards
9087
-define(IS_BENIGN_EXIT(R),
@@ -1615,3 +1612,23 @@ find_powershell() ->
16151612
PwshExe ->
16161613
PwshExe
16171614
end.
1615+
1616+
%% Returns true if Pred(Key, Value) returns true for at least one Key to Value association in Map.
1617+
%% The Pred function must return a boolean.
1618+
-spec maps_any(Pred, Map) -> boolean() when
1619+
Pred :: fun((Key, Value) -> boolean()),
1620+
Map :: #{Key => Value}.
1621+
maps_any(Pred, Map)
1622+
when is_function(Pred, 2) andalso is_map(Map) ->
1623+
I = maps:iterator(Map),
1624+
maps_any_1(Pred, maps:next(I)).
1625+
1626+
maps_any_1(_Pred, none) ->
1627+
false;
1628+
maps_any_1(Pred, {K, V, I}) ->
1629+
case Pred(K, V) of
1630+
true ->
1631+
true;
1632+
false ->
1633+
maps_any_1(Pred, maps:next(I))
1634+
end.

deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_handler.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828
upgrade/5,
2929
takeover/7]).
3030

31-
<<<<<<< HEAD
32-
-type option(T) :: undefined | T.
33-
=======
3431
-define(APP, rabbitmq_web_mqtt).
35-
>>>>>>> 1402183bc2 (Introduce a way to disable FHC use in web_mqtt)
3632

3733
-record(state, {
3834
socket :: {rabbit_proxy_socket, any(), any()} | rabbit_net:socket(),
@@ -41,9 +37,9 @@
4137
rabbit_mqtt_processor:state(),
4238
connection_state = running :: running | blocked,
4339
conserve = false :: boolean(),
44-
stats_timer :: option(rabbit_event:state()),
40+
stats_timer :: rabbit_types:option(rabbit_event:state()),
4541
keepalive = rabbit_mqtt_keepalive:init() :: rabbit_mqtt_keepalive:state(),
46-
conn_name :: option(binary()),
42+
conn_name :: rabbit_types:option(binary()),
4743
should_use_fhc :: rabbit_types:option(boolean())
4844
}).
4945

0 commit comments

Comments
 (0)