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:
Andrew Mayorov 2023-11-20 15:49:01 +07:00
parent ddde927bd6
commit d7974d835f
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 3 additions and 1 deletions

View File

@ -242,7 +242,9 @@ with_redispatch_to(Msg, Group, Topic) ->
is_redispatch_needed(#message{qos = ?QOS_0}) ->
false;
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.
redispatch(Messages0) ->