From eeb480c05139fcd1dfac229ad6573b6979c77ff6 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Fri, 30 Apr 2021 14:38:07 +0200 Subject: [PATCH 1/3] core(deps): pin ekka 0.7.7 --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 7e7014123..726b7c43f 100644 --- a/rebar.config +++ b/rebar.config @@ -7,7 +7,7 @@ {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.7.1"}}}, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.7.5"}}}, - {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.7.6"}}}, + {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.7.7"}}}, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.0"}}}, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.0.0"}}} ]}. From e10e241fe9d368da93a4893368f5989c1cfdc20c Mon Sep 17 00:00:00 2001 From: Turtle Date: Fri, 4 Jun 2021 01:01:42 +0800 Subject: [PATCH 2/3] chore: export function --- src/emqx.appup.src | 6 ++++++ src/emqx_channel.erl | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/emqx.appup.src b/src/emqx.appup.src index a10c1d209..82c52e46c 100644 --- a/src/emqx.appup.src +++ b/src/emqx.appup.src @@ -79,6 +79,9 @@ {load_module, emqx_trie, soft_purge, soft_purge, []}, {load_module, emqx_router, soft_purge, soft_purge, [emqx_trie]} ]}, + {<<"4.2.6">>, [ + {load_module, emqx_channel, brutal_purge, soft_purge, []} + ]}, {<<".*">>, []} ], [ @@ -159,6 +162,9 @@ {load_module, emqx_trie, soft_purge, soft_purge, [emqx_router]}, {load_module, emqx_router, soft_purge, soft_purge, []} ]}, + {<<"4.2.6">>, [ + {load_module, emqx_channel, brutal_purge, soft_purge, []} + ]}, {<<".*">>, []} ] }. diff --git a/src/emqx_channel.erl b/src/emqx_channel.erl index 679d2c72a..659d0eb08 100644 --- a/src/emqx_channel.erl +++ b/src/emqx_channel.erl @@ -49,7 +49,10 @@ ]). %% Export for emqx_sn --export([do_deliver/2]). +-export([ do_deliver/2 + , ensure_keepalive/2 + , clear_keepalive/1 + ]). %% Exports for CT -export([set_field/3]). @@ -1512,6 +1515,14 @@ ensure_keepalive_timer(Interval, Channel = #channel{clientinfo = #{zone := Zone} Keepalive = emqx_keepalive:init(round(timer:seconds(Interval) * Backoff)), ensure_timer(alive_timer, Channel#channel{keepalive = Keepalive}). +clear_keepalive(Channel = #channel{timers = Timers}) -> + case maps:get(alive_timer, Timers, undefined) of + undefined -> + Channel; + TRef -> + emqx_misc:cancel_timer(TRef), + Channel#channel{timers = maps:without([alive_timer], Timers)} + end. %%-------------------------------------------------------------------- %% Maybe Resume Session From 830150b3094e38ce8229534ffe78adb62de09d3b Mon Sep 17 00:00:00 2001 From: Turtle Date: Thu, 17 Jun 2021 11:24:12 +0800 Subject: [PATCH 3/3] chore: update ekka tag --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 726b7c43f..d2c01e58d 100644 --- a/rebar.config +++ b/rebar.config @@ -7,7 +7,7 @@ {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.7.1"}}}, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.7.5"}}}, - {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.7.7"}}}, + {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.7.8"}}}, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.0"}}}, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.0.0"}}} ]}.