Merge branch 'main-v4.3' into fix-shared-subs-dead-msg-loop

This commit is contained in:
JianBo He 2022-09-08 16:18:50 +08:00 committed by GitHub
commit ce5cca438a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View File

@ -17,6 +17,7 @@ File format:
- Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849)
- Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862)
- Fix a possible dead loop caused by shared subscriptions with `shared_dispatch_ack_enabled=true`. [#8918](https://github.com/emqx/emqx/pull/8918)
- Fix dashboard binding IP address not working. [#8916](https://github.com/emqx/emqx/pull/8916)
## v4.3.19

View File

@ -11,7 +11,7 @@
]}.
{mapping, "dashboard.listener.http", "emqx_dashboard.listeners", [
{datatype, integer}
{datatype, [integer, ip]}
]}.
{mapping, "dashboard.listener.http.acceptors", "emqx_dashboard.listeners", [
@ -39,7 +39,7 @@
]}.
{mapping, "dashboard.listener.https", "emqx_dashboard.listeners", [
{datatype, integer}
{datatype, [integer, ip]}
]}.
{mapping, "dashboard.listener.https.acceptors", "emqx_dashboard.listeners", [

View File

@ -54,7 +54,8 @@ start_listener({Proto, Port, Options}) when Proto == https ->
{"/api/v4/[...]", minirest, http_handlers()}],
minirest:start_https(listener_name(Proto), ranch_opts(Port, Options), Dispatch).
ranch_opts(Port, Options0) ->
ranch_opts(Bind, Options0) ->
IpPort = ip_port(Bind),
NumAcceptors = get_value(num_acceptors, Options0, 4),
MaxConnections = get_value(max_connections, Options0, 512),
Options = lists:foldl(fun({K, _V}, Acc) when K =:= max_connections orelse K =:= num_acceptors ->
@ -68,7 +69,13 @@ ranch_opts(Port, Options0) ->
end, [], Options0),
#{num_acceptors => NumAcceptors,
max_connections => MaxConnections,
socket_opts => [{port, Port} | Options]}.
socket_opts => IpPort ++ Options}.
ip_port({IpStr, Port}) ->
{ok, Ip} = inet:parse_address(IpStr),
[{ip, Ip}, {port, Port}];
ip_port(Port) when is_integer(Port) ->
[{port, Port}].
stop_listeners() ->
lists:foreach(fun(Listener) -> stop_listener(Listener) end, listeners()).

View File

@ -326,7 +326,12 @@ setup_node(Node, Apps) ->
application:set_env(emqx_management, listeners, []),
ok;
(emqx_dashboard) ->
application:set_env(emqx_dashboard, listeners, []),
Options = [{http,{"127.0.0.1",18184},
[{num_acceptors,4},
{max_connections,512},
{inet6,false},
{ipv6_v6only,false}]}],
application:set_env(emqx_dashboard, listeners, Options),
ok;
(_) ->
ok