Merge pull request #6489 from HJianBo/fix-receive-maximum
fix: disconnect the client due to exceed receive-maximum packets
This commit is contained in:
commit
98b9eb9fe1
|
@ -1,7 +1,7 @@
|
|||
{application, emqx,
|
||||
[{id, "emqx"},
|
||||
{description, "EMQ X"},
|
||||
{vsn, "4.3.12"}, % strict semver, bump manually!
|
||||
{vsn, "4.3.13"}, % strict semver, bump manually!
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [kernel,stdlib,gproc,gen_rpc,esockd,cowboy,sasl,os_mon]},
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
%% -*- mode: erlang -*-
|
||||
{VSN,
|
||||
[{"4.3.11",
|
||||
[{"4.3.12",
|
||||
[{load_module,emqx_channel,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.11",
|
||||
[{load_module,emqx_connection,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_vm,brutal_purge,soft_purge,[]},
|
||||
|
@ -196,7 +198,9 @@
|
|||
{load_module,emqx_rpc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]}]},
|
||||
{<<".*">>,[]}],
|
||||
[{"4.3.11",
|
||||
[{"4.3.12",
|
||||
[{load_module,emqx_channel,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.11",
|
||||
[{load_module,emqx_connection,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_vm,brutal_purge,soft_purge,[]},
|
||||
|
|
|
@ -599,7 +599,7 @@ do_publish(PacketId, Msg = #message{qos = ?QOS_2},
|
|||
?LOG(warning, "Dropped the qos2 packet ~w "
|
||||
"due to awaiting_rel is full.", [PacketId]),
|
||||
ok = emqx_metrics:inc('packets.publish.dropped'),
|
||||
handle_out(pubrec, {PacketId, RC}, Channel)
|
||||
handle_out(disconnect, RC, Channel)
|
||||
end.
|
||||
|
||||
ensure_quota(_, Channel = #channel{quota = undefined}) ->
|
||||
|
|
|
@ -209,7 +209,8 @@ t_handle_in_qos2_publish_with_error_return(_) ->
|
|||
{ok, ?PUBREC_PACKET(2, ?RC_NO_MATCHING_SUBSCRIBERS), Channel1} =
|
||||
emqx_channel:handle_in(Publish2, Channel),
|
||||
Publish3 = ?PUBLISH_PACKET(?QOS_2, <<"topic">>, 3, <<"payload">>),
|
||||
{ok, ?PUBREC_PACKET(3, ?RC_RECEIVE_MAXIMUM_EXCEEDED), Channel1} =
|
||||
{ok, [{outgoing, ?DISCONNECT_PACKET(?RC_RECEIVE_MAXIMUM_EXCEEDED)},
|
||||
{close, receive_maximum_exceeded}], Channel1} =
|
||||
emqx_channel:handle_in(Publish3, Channel1).
|
||||
|
||||
t_handle_in_puback_ok(_) ->
|
||||
|
|
Loading…
Reference in New Issue