From 46557c34625f143e64e8ff670592f0fd477c9401 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 18 Sep 2023 17:04:23 +0200 Subject: [PATCH 1/2] fix(emqtt): upgrade from 1.8.6 to 1.8.7 --- apps/emqx/rebar.config | 4 ++-- apps/emqx_retainer/rebar.config | 2 +- mix.exs | 2 +- rebar.config | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index d1419703c..70a0f4c70 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -45,7 +45,7 @@ {meck, "0.9.2"}, {proper, "1.4.0"}, {bbmustache, "1.10.0"}, - {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.6"}}} + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.7"}}} ]}, {extra_src_dirs, [{"test", [recursive]}, {"integration_test", [recursive]}]} @@ -55,7 +55,7 @@ {meck, "0.9.2"}, {proper, "1.4.0"}, {bbmustache, "1.10.0"}, - {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.6"}}} + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.7"}}} ]}, {extra_src_dirs, [{"test", [recursive]}]} ]} diff --git a/apps/emqx_retainer/rebar.config b/apps/emqx_retainer/rebar.config index ab4b8ed37..6cee49bd3 100644 --- a/apps/emqx_retainer/rebar.config +++ b/apps/emqx_retainer/rebar.config @@ -30,7 +30,7 @@ {profiles, [ {test, [ {deps, [ - {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.6"}}} + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.7"}}} ]} ]} ]}. diff --git a/mix.exs b/mix.exs index 1cb296ed3..272013943 100644 --- a/mix.exs +++ b/mix.exs @@ -64,7 +64,7 @@ defmodule EMQXUmbrella.MixProject do {:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true}, # maybe forbid to fetch quicer {:emqtt, - github: "emqx/emqtt", tag: "1.8.6", override: true, system_env: maybe_no_quic_env()}, + github: "emqx/emqtt", tag: "1.8.7", override: true, system_env: maybe_no_quic_env()}, {:rulesql, github: "emqx/rulesql", tag: "0.1.7"}, {:observer_cli, "1.7.1"}, {:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.3"}, diff --git a/rebar.config b/rebar.config index b79bc2461..c2c73274a 100644 --- a/rebar.config +++ b/rebar.config @@ -69,7 +69,7 @@ , {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.4"}}} , {replayq, {git, "https://github.com/emqx/replayq.git", {tag, "0.3.7"}}} , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}} - , {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.6"}}} + , {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.7"}}} , {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.7"}}} , {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x , {system_monitor, {git, "https://github.com/ieQu1/system_monitor", {tag, "3.0.3"}}} From 4f1ec795ebbb0cbb3f98c6968cc512dc26c70d6e Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 18 Sep 2023 17:08:01 +0200 Subject: [PATCH 2/2] test: delete special handling of emqtt race condition the race should have been fixed in emqtt 1.8.7 --- apps/emqx/test/emqx_crl_cache_SUITE.erl | 31 ++++++++----------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/apps/emqx/test/emqx_crl_cache_SUITE.erl b/apps/emqx/test/emqx_crl_cache_SUITE.erl index 248013ce9..3d02d02ca 100644 --- a/apps/emqx/test/emqx_crl_cache_SUITE.erl +++ b/apps/emqx/test/emqx_crl_cache_SUITE.erl @@ -924,8 +924,8 @@ t_not_cached_and_unreachable(Config) -> ]), Ref = get_crl_cache_table(), ?assertEqual([], ets:tab2list(Ref)), - process_flag(trap_exit, true), - ?assertMatch({error, {{shutdown, {tls_alert, {bad_certificate, _}}}, _}}, emqtt:connect(C)), + unlink(C), + ?assertMatch({error, {ssl_error, _Sock, {tls_alert, {bad_certificate, _}}}}, emqtt:connect(C)), ok. t_revoked(Config) -> @@ -940,21 +940,10 @@ t_revoked(Config) -> ]}, {port, 8883} ]), - process_flag(trap_exit, true), - Res = emqtt:connect(C), - %% apparently, sometimes there's some race condition in - %% `emqtt_sock:ssl_upgrade' when it calls - %% `ssl:conetrolling_process' and a bad match happens at that - %% point. - case Res of - {error, {{shutdown, {tls_alert, {certificate_revoked, _}}}, _}} -> - ok; - {error, closed} -> - %% race condition? - ok; - _ -> - ct:fail("unexpected result: ~p", [Res]) - end, + unlink(C), + ?assertMatch( + {error, {ssl_error, _Sock, {tls_alert, {certificate_revoked, _}}}}, emqtt:connect(C) + ), ok. t_revoke_then_refresh(Config) -> @@ -993,9 +982,9 @@ t_revoke_then_refresh(Config) -> ]}, {port, 8883} ]), - process_flag(trap_exit, true), + unlink(C1), ?assertMatch( - {error, {{shutdown, {tls_alert, {certificate_revoked, _}}}, _}}, emqtt:connect(C1) + {error, {ssl_error, _Sock, {tls_alert, {certificate_revoked, _}}}}, emqtt:connect(C1) ), ok. @@ -1068,7 +1057,6 @@ do_t_update_listener(Config) -> ), %% Now should use CRL information to block connection - process_flag(trap_exit, true), {ok, C1} = emqtt:start_link([ {ssl, true}, {ssl_opts, [ @@ -1077,8 +1065,9 @@ do_t_update_listener(Config) -> ]}, {port, 8883} ]), + unlink(C1), ?assertMatch( - {error, {{shutdown, {tls_alert, {certificate_revoked, _}}}, _}}, emqtt:connect(C1) + {error, {ssl_error, _Sock, {tls_alert, {certificate_revoked, _}}}}, emqtt:connect(C1) ), assert_http_get(<>),