Compare commits

...

8 Commits

Author SHA1 Message Date
zmstone a105d0c13e docs: add changelog for e5.6.1-patch.2 2024-06-08 18:19:38 +02:00
zmstone ba56ab9de6 chore: bump char version to e5.6.1-patch.2 2024-06-08 18:17:05 +02:00
zmstone 1863731ecb
Merge pull request #13208 from SergeTupchiy/PATCH-EEC-1039-e5.6.0-jwks-user-agent
PATCH fix(emqx_authn_jwks) add a user-agent header to jwks HTTP request
2024-06-08 18:15:43 +02:00
Serge Tupchii b6d7d8b5cd fix(mix.exs): fix rebar/mix mimerl conflict 2024-06-07 18:15:08 +03:00
Serge Tupchii 9ede0d7916 chore: bump EMQX_RELEASE_EE amd emqx app vsn 2024-06-07 17:58:40 +03:00
Serge Tupchii a13c961744 fix(emqx_authn_jwks): add a user-agent header to jwks HTTP request 2024-06-07 17:50:06 +03:00
zmstone a2a598469e
Merge pull request #13206 from emqx/0607-patch-qlc-leak-for-5.6
fix(retainer): fix qlc cursor cleanup
2024-06-07 13:44:29 +02:00
Ilya Averyanov 986e7dc1a6 fix(retainer): fix qlc cursor cleanup 2024-06-07 13:38:50 +02:00
9 changed files with 86 additions and 7 deletions

View File

@ -35,4 +35,4 @@
-define(EMQX_RELEASE_CE, "5.6.1").
%% Enterprise edition
-define(EMQX_RELEASE_EE, "5.6.1").
-define(EMQX_RELEASE_EE, "5.6.1-patch.2").

View File

@ -2,7 +2,7 @@
{application, emqx, [
{id, "emqx"},
{description, "EMQX Core"},
{vsn, "5.2.1"},
{vsn, "5.2.2"},
{modules, []},
{registered, []},
{applications, [

View File

@ -1,7 +1,7 @@
%% -*- mode: erlang -*-
{application, emqx_auth_jwt, [
{description, "EMQX JWT Authentication and Authorization"},
{vsn, "0.2.0"},
{vsn, "0.2.1"},
{registered, []},
{mod, {emqx_auth_jwt_app, []}},
{applications, [

View File

@ -159,7 +159,10 @@ refresh_jwks(
case
httpc:request(
get,
{Endpoint, [{"Accept", "application/json"}]},
{Endpoint, [
{"Accept", "application/json"},
{"User-Agent", "EMQX/" ++ emqx_release:version_with_prefix()}
]},
HTTPOpts,
[{body_format, binary}, {sync, false}, {receiver, self()}]
)

View File

@ -255,6 +255,8 @@ deliver([], Context, Pid, Topic, Cursor, Limiter) ->
deliver(Result, Context, Pid, Topic, Cursor, Limiter) ->
case erlang:is_process_alive(Pid) of
false ->
ok = close_cursor(Cursor),
?tp(debug, retainer_dispatcher_no_receiver, #{topic => Topic}),
{ok, Limiter};
_ ->
DeliverNum = emqx_conf:get([retainer, flow_control, batch_deliver_number], undefined),
@ -272,6 +274,11 @@ deliver(Result, Context, Pid, Topic, Cursor, Limiter) ->
end
end.
close_cursor({{qlc_cursor, _} = Cursor, _}) ->
qlc:delete_cursor(Cursor);
close_cursor(_Cursor) ->
ok.
do_deliver([], _DeliverNum, _Pid, _Topic, Limiter) ->
{ok, Limiter};
do_deliver(Msgs, DeliverNum, Pid, Topic, Limiter) ->

View File

@ -21,6 +21,7 @@
-include("emqx_retainer.hrl").
-include_lib("emqx/include/asserts.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
@ -461,6 +462,66 @@ t_flow_control(_) ->
}),
ok.
t_cursor_cleanup(_) ->
Rate = emqx_ratelimiter_SUITE:to_rate("1/1s"),
LimiterCfg = make_limiter_cfg(Rate),
JsonCfg = make_limiter_json(<<"1/1s">>),
emqx_limiter_server:add_bucket(emqx_retainer, internal, LimiterCfg),
emqx_retainer:update_config(#{
<<"delivery_rate">> => <<"1/1s">>,
<<"flow_control">> =>
#{
<<"batch_read_number">> => 1,
<<"batch_deliver_number">> => 1,
<<"batch_deliver_limiter">> => JsonCfg
}
}),
{ok, C1} = emqtt:start_link([{clean_start, true}, {proto_ver, v5}]),
{ok, _} = emqtt:connect(C1),
lists:foreach(
fun(I) ->
emqtt:publish(
C1,
<<"retained/", (integer_to_binary(I))/binary>>,
<<"this is a retained message">>,
[{qos, 0}, {retain, true}]
)
end,
lists:seq(1, 5)
),
{ok, #{}, [0]} = emqtt:subscribe(C1, <<"retained/#">>, [{qos, 0}, {rh, 0}]),
snabbkaffe:start_trace(),
?assertWaitEvent(
emqtt:disconnect(C1),
#{?snk_kind := retainer_dispatcher_no_receiver, topic := <<"retained/#">>},
2000
),
QLCProcesses = lists:filter(
fun(Pid) ->
{current_function, {qlc, wait_for_request, 3}} =:=
erlang:process_info(Pid, current_function)
end,
erlang:processes()
),
?assertEqual(0, length(QLCProcesses)),
snabbkaffe:stop(),
emqx_limiter_server:del_bucket(emqx_retainer, internal),
emqx_retainer:update_config(#{
<<"flow_control">> =>
#{
<<"batch_read_number">> => 1,
<<"batch_deliver_number">> => 1
}
}),
ok.
t_clear_expired(_) ->
ConfMod = fun(Conf) ->
Conf#{

View File

@ -0,0 +1,7 @@
# e5.6.1-patch.1
Fix retainer QLC process leak. See PR #13206
# e5.6.1-patch.2
Add User-Agent header to jwks HTTP request. See PR #13208

View File

@ -14,8 +14,8 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 5.6.1
version: 5.6.1-patch.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 5.6.1
appVersion: 5.6.1-patch.2

View File

@ -100,7 +100,8 @@ defmodule EMQXUmbrella.MixProject do
{:rfc3339, github: "emqx/rfc3339", tag: "0.2.3", override: true},
{:bcrypt, github: "emqx/erlang-bcrypt", tag: "0.6.2", override: true},
{:uuid, github: "okeuday/uuid", tag: "v2.0.6", override: true},
{:quickrand, github: "okeuday/quickrand", tag: "v2.0.6", override: true}
{:quickrand, github: "okeuday/quickrand", tag: "v2.0.6", override: true},
{:mimerl, "1.2.0", override: true}
] ++
emqx_apps(profile_info, version) ++
enterprise_deps(profile_info) ++ jq_dep() ++ quicer_dep()