Merge pull request #11622 from zmstone/0917-upgrade-gen_rpc-to-3.1.0

chore(gen_rpc): upgrade from 2.8.1 to 3.1.0
This commit is contained in:
Zaiming (Stone) Shi 2023-09-19 10:22:53 +02:00 committed by GitHub
commit 65818740f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 14 deletions

View File

@ -29,7 +29,7 @@
{cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}},
{esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.7"}}},
{ekka, {git, "https://github.com/emqx/ekka", {tag, "0.15.13"}}},
{gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.8.1"}}},
{gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.1.0"}}},
{hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.39.16"}}},
{emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.3"}}},
{pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}},

View File

@ -22,6 +22,9 @@
-export([init/1]).
%% for test
-export([restart_flapping/0]).
%%--------------------------------------------------------------------
%% API
%%--------------------------------------------------------------------
@ -59,3 +62,8 @@ child_spec(Mod, Shutdown, Type) ->
type => Type,
modules => [Mod]
}.
restart_flapping() ->
ok = supervisor:terminate_child(?MODULE, emqx_flapping),
{ok, _} = supervisor:restart_child(?MODULE, emqx_flapping),
ok.

View File

@ -133,7 +133,9 @@ t_conf_update(_) ->
ok.
t_conf_update_timer(_Config) ->
_ = emqx_flapping:start_link(),
%% delete all zones
?assertMatch({ok, _}, emqx:update_config([zones], #{})),
emqx_cm_sup:restart_flapping(),
validate_timer([{default, true}]),
%% change zones
{ok, _} =

View File

@ -513,7 +513,7 @@ test_two_messages(Strategy, Group) ->
ok.
last_message(ExpectedPayload, Pids) ->
last_message(ExpectedPayload, Pids, 100).
last_message(ExpectedPayload, Pids, 1000).
last_message(ExpectedPayload, Pids, Timeout) ->
receive
@ -1234,16 +1234,25 @@ setup_node(Node, Port) ->
ok
end,
%% Load env before doing anything
[ok = rpc:call(Node, application, load, [App]) || App <- [gen_rpc, emqx, ekka, mria]],
%% Needs to be set explicitly because ekka:start() (which calls `gen` is called without Handler
%% in emqx_common_test_helpers:start_apps(...)
ok = rpc:call(Node, application, set_env, [gen_rpc, tcp_server_port, Port - 1]),
ok = rpc:call(Node, application, set_env, [gen_rpc, port_discovery, manual]),
MyPort = Port - 1,
PeerPort = Port - 2,
ok = pair_gen_rpc(node(), MyPort, PeerPort),
ok = pair_gen_rpc(Node, PeerPort, MyPort),
%% Here we start the node and make it join the cluster
ok = rpc:call(Node, emqx_common_test_helpers, start_apps, [[], EnvHandler]),
rpc:call(Node, mria, join, [node()]),
%% warm it up, also assert the peer ndoe name
Node = emqx_rpc:call(Node, erlang, node, []),
rpc:call(Node, mria, join, [node()]),
ok.
pair_gen_rpc(Node, LocalPort, RemotePort) ->
_ = rpc:call(Node, application, load, [gen_rpc]),
ok = rpc:call(Node, application, set_env, [gen_rpc, port_discovery, manual]),
ok = rpc:call(Node, application, set_env, [gen_rpc, tcp_server_port, LocalPort]),
ok = rpc:call(Node, application, set_env, [gen_rpc, tcp_client_port, RemotePort]),
ok = rpc:call(Node, application, set_env, [gen_rpc, default_client_driver, tcp]),
_ = rpc:call(Node, application, stop, [gen_rpc]),
{ok, _} = rpc:call(Node, application, ensure_all_started, [gen_rpc]),
ok.

View File

@ -29,7 +29,7 @@
-include_lib("eunit/include/eunit.hrl").
-include_lib("emqx/include/emqx.hrl").
-include("emqx_dashboard.hrl").
-include_lib("emqx_dashboard/include/emqx_dashboard.hrl").
-define(HOST, "http://127.0.0.1:18083").

View File

@ -0,0 +1 @@
Upgrade rpc library gen_rpc from 2.8.1 to 3.1.0

View File

@ -56,7 +56,7 @@ defmodule EMQXUmbrella.MixProject do
{:esockd, github: "emqx/esockd", tag: "5.9.7", override: true},
{:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-1", override: true},
{:ekka, github: "emqx/ekka", tag: "0.15.13", override: true},
{:gen_rpc, github: "emqx/gen_rpc", tag: "2.8.1", override: true},
{:gen_rpc, github: "emqx/gen_rpc", tag: "3.1.0", override: true},
{:grpc, github: "emqx/grpc-erl", tag: "0.6.8", override: true},
{:minirest, github: "emqx/minirest", tag: "1.3.12", override: true},
{:ecpool, github: "emqx/ecpool", tag: "0.5.4", override: true},

View File

@ -63,7 +63,7 @@
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.7"}}}
, {rocksdb, {git, "https://github.com/emqx/erlang-rocksdb", {tag, "1.8.0-emqx-1"}}}
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.15.13"}}}
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.8.1"}}}
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.1.0"}}}
, {grpc, {git, "https://github.com/emqx/grpc-erl", {tag, "0.6.8"}}}
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "1.3.12"}}}
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.4"}}}