fix(sharesub): anticipate messages w/o redispatch header
For instance, `emqx_session_mem` will push almost all of the messages that are still in the state to `emqx_shared_sub:redispatch/1`. After this commit, the session will no longer crash during channel terminate.
This commit is contained in:
parent
ddde927bd6
commit
d7974d835f
|
@ -242,7 +242,9 @@ with_redispatch_to(Msg, Group, Topic) ->
|
||||||
is_redispatch_needed(#message{qos = ?QOS_0}) ->
|
is_redispatch_needed(#message{qos = ?QOS_0}) ->
|
||||||
false;
|
false;
|
||||||
is_redispatch_needed(#message{headers = #{redispatch_to := ?REDISPATCH_TO(_, _)}}) ->
|
is_redispatch_needed(#message{headers = #{redispatch_to := ?REDISPATCH_TO(_, _)}}) ->
|
||||||
true.
|
true;
|
||||||
|
is_redispatch_needed(#message{}) ->
|
||||||
|
false.
|
||||||
|
|
||||||
%% @doc Redispatch shared deliveries to other members in the group.
|
%% @doc Redispatch shared deliveries to other members in the group.
|
||||||
redispatch(Messages0) ->
|
redispatch(Messages0) ->
|
||||||
|
|
Loading…
Reference in New Issue