Merge pull request #10091 from terry-xiaoyu/some-small-fixes

Avoid replacing newlines with commas in log msg
This commit is contained in:
Xinyu Liu 2023-03-08 17:26:56 +08:00 committed by GitHub
commit 27a1128e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 5 deletions

15
changes/v4.4.16-en.md Normal file
View File

@ -0,0 +1,15 @@
# v4.4.16
## Enhancements
## Bug fixes
- Avoid changing the payload of MQTT messages when printing debug logs [#10091](https://github.com/emqx/emqx/pull/10091).
Before this fix, if EMQX receives a message with Payload "e\ne\nc\nc\n2\n\n\n", the log message will be as follows:
```
2023-03-08T13:28:04.320622+08:00 [debug] mqttx_e34bd582@127.0.0.1:54020 [MQTT] RECV PUBLISH(Q1, R0, D0, Topic=t/1, PacketId=39467, Payload=e, e, c, c, 2, , , )
```
This is the corresponding log message now:
```
2023-03-08T14:26:50.935575+08:00 [debug] mqttx_e34bd582@127.0.0.1:54020 [MQTT] RECV PUBLISH(Q1, R0, D0, Topic=t/1, PacketId=39467, Payload=<<"e\ne\nc\nc\n2\n\n\n">>)
```

15
changes/v4.4.16-zh.md Normal file
View File

@ -0,0 +1,15 @@
# v4.4.16
## 增强
## 修复
- 避免打印 debug 日志的时候改动 MQTT 消息的 Payload 的内容 [#10091](https://github.com/emqx/emqx/pull/10091)
在这个修复之前,如果 EMQX 收到一个 Payload 为 "e\ne\nc\nc\n2\n\n\n" 的消息,日志打印会变成这样:
```
2023-03-08T13:28:04.320622+08:00 [debug] mqttx_e34bd582@127.0.0.1:54020 [MQTT] RECV PUBLISH(Q1, R0, D0, Topic=t/1, PacketId=39467, Payload=e, e, c, c, 2, , , )
```
这是此修复之后的样子:
```
2023-03-08T14:26:50.935575+08:00 [debug] mqttx_e34bd582@127.0.0.1:54020 [MQTT] RECV PUBLISH(Q1, R0, D0, Topic=t/1, PacketId=39467, Payload=<<"e\ne\nc\nc\n2\n\n\n">>)
```

View File

@ -1,6 +1,6 @@
{application, emqx_dashboard,
[{description, "EMQX Web Dashboard"},
{vsn, "4.4.14"}, % strict semver, bump manually!
{vsn, "4.4.15"}, % strict semver, bump manually!
{modules, []},
{registered, [emqx_dashboard_sup]},
{applications, [kernel,stdlib,mnesia,minirest]},

View File

@ -6,7 +6,7 @@
%% the emqx `release' version, which in turn is comprised of several
%% apps, one of which is this. See `emqx_release.hrl' for more
%% info.
{vsn, "4.4.15"}, % strict semver, bump manually!
{vsn, "4.4.16"}, % strict semver, bump manually!
{modules, []},
{registered, []},
{applications, [ kernel

View File

@ -1,7 +1,11 @@
%% -*- mode: erlang -*-
%% Unless you know what you are doing, DO NOT edit manually!!
{VSN,
[{"4.4.14",
[{"4.4.15",
[{load_module,emqx_packet,brutal_purge,soft_purge,[]},
{load_module,emqx_relup,brutal_purge,soft_purge,[]},
{load_module,emqx_app,brutal_purge,soft_purge,[]}]},
{"4.4.14",
[{load_module,emqx_vm,brutal_purge,soft_purge,[]},
{load_module,emqx_keepalive,brutal_purge,soft_purge,[]},
{load_module,emqx_broker,brutal_purge,soft_purge,[]},
@ -494,7 +498,11 @@
{apply,{application,set_env,
[gen_rpc,insecure_auth_fallback_allowed,true]}}]},
{<<".*">>,[]}],
[{"4.4.14",
[{"4.4.15",
[{load_module,emqx_packet,brutal_purge,soft_purge,[]},
{load_module,emqx_relup,brutal_purge,soft_purge,[]},
{load_module,emqx_app,brutal_purge,soft_purge,[]}]},
{"4.4.14",
[{load_module,emqx_vm,brutal_purge,soft_purge,[]},
{load_module,emqx_keepalive,brutal_purge,soft_purge,[]},
{load_module,emqx_broker,brutal_purge,soft_purge,[]},

View File

@ -438,7 +438,7 @@ format_variable(undefined, _) ->
format_variable(Variable, undefined) ->
format_variable(Variable);
format_variable(Variable, Payload) ->
[format_variable(Variable), ", Payload=", Payload].
[format_variable(Variable), io_lib:format(", Payload=~0p", [Payload])].
format_variable(#mqtt_packet_connect{
proto_ver = ProtoVer,