Преглед изворни кода

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.
Andrew Mayorov пре 2 година
родитељ
комит
d7974d835f
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      apps/emqx/src/emqx_shared_sub.erl

+ 3 - 1
apps/emqx/src/emqx_shared_sub.erl

@@ -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) ->