Commit Graph

2421 Commits

Author SHA1 Message Date
zhongwencool 06adcb9126 Merge branch 'dev/v4.3.14' into export-test-case-v4.3.14 2022-03-29 15:55:24 +08:00
zhongwencool b47aef63a1 fix: emqx.appup.src 2022-03-29 15:16:57 +08:00
zhongwencool f9a85614d4 chore: export test function for ee's hot-conf 2022-03-29 14:52:35 +08:00
JimMoen b17fd40091 chore(exhook): update appup.src, add field when updating module 2022-03-28 15:54:38 +08:00
JimMoen 38c515908f feat(hook): put emqx_hook with more fields 2022-03-25 09:58:13 +08:00
JianBo He 604c384660 fix(channel): send will_msg if client has been kicked 2022-03-21 10:56:55 +08:00
JianBo He 8d3e953eef fix(channel): send DISCONNECT packet if connection has been kicked
fix #7241
2022-03-21 10:56:37 +08:00
zhongwencool b8afd2760c
Merge pull request #7318 from zhongwencool/fix-bad-str
fix: Add name string legitimacy check.
2022-03-17 17:49:25 +08:00
zhongwencool bfadcebb9c chore: remind the user to delete bad appid/username. 2022-03-16 15:23:10 +08:00
zhongwencool f70d777623 chore: update appup 2022-03-16 11:19:25 +08:00
zhongwencool b44512cdab fix: Add string legitimacy check. 2022-03-16 10:31:41 +08:00
William Yang 81ed61b001 feat: add load control app 2022-03-15 14:02:42 +01:00
Chris Hicks 32fac8b67b
Merge pull request #7299 from mononym/fix-typo-in-log-message
fix: typo in log message
2022-03-14 12:55:04 +01:00
Chris 55eddfa16c fix: typo in log message 2022-03-14 10:18:18 +01:00
JimMoen 8ea84e4a01 chore(appup): update appup.src 2022-03-10 12:12:42 +08:00
JimMoen c0b688b51f feat(frame): utf-8 string check in `strict_mode` 2022-03-10 11:23:44 +08:00
Zaiming (Stone) Shi d8e29f19cb refactor(appup): always generate appup from script 2022-03-08 13:24:54 +01:00
DDDHuang fbd70b02bc fix: override plugins list 2022-03-07 10:32:49 +08:00
DDDHuang 278fa96bc1 fix(plugins): usort plugin list 2022-03-04 10:46:09 +08:00
Zaiming (Stone) Shi cca9e52c9a chore(appup): add missing appup instructions 2022-03-01 11:41:52 +01:00
zhongwencool b1816a6647 fix: add uptime/1 for CT test. 2022-03-01 14:19:37 +08:00
zhongwencool ed41a66c6e fix: rpc get node info maybe crash when emqx_sys process is not start yet. 2022-03-01 14:19:35 +08:00
Thales Macedo Garitezi cf1cc7e9db
chore(appup): update appup files 2022-02-24 17:14:47 -03:00
Thales Macedo Garitezi 6b93127ecb
fix(sys_mon): guard before calling `erlang:port_info`
Port of #7108 .

Sometimes, the `emqx_sys_mon:procinfo/1` might be called with
something that is not a port, like `[]`.  Not sure on the conditions
for this to happen.

```
2022-02-18T20:05:02.671592+00:00 [error] Generic server emqx_sys_mon terminating. Reason: {badarg,[{erlang,port_info,[[]],[{error_info,#{module => erl_erts_errors}}]},{emqx_sys_mon,portinfo,1,[{file,"/emqx/apps/emqx/src/emqx_sys_mon.erl"},{line,205}]},{emqx_sys_mon,'-handle_info/2-fun-5-',2,[{file,"/emqx/apps/emqx/src/emqx_sys_mon.erl"},{line,150}]},{emqx_sys_mon,suppress,3,[{file,"/emqx/apps/emqx/src/emqx_sys_mon.erl"},{line,184}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,695}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,771}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}. Last message: {monitor,<0.7796.0>,busy_dist_port,[]}. State: #{events => [{busy_dist_port,#Port<0.127>}],timer => #Ref<0.2758388682.1853620226.133920>}.
```
2022-02-24 16:28:35 -03:00
JianBo He d622eb848f refactor(cm): rename takeover -> request_stepdown
see: https://github.com/emqx/emqx/pull/7026#pullrequestreview-891954135
2022-02-24 14:43:46 +08:00
JianBo He 4673ca43a0 chore(emqx): update appup.src 2022-02-24 11:51:00 +08:00
JianBo He bfd0fd9019 refactor(cm): rename call_or_kill to takeover 2022-02-24 11:50:57 +08:00
JianBo He 6dd0b49dd2 feat(cm): force shutdown of processe that cannot answer takeover event
Related PR: #6030
2022-02-24 09:53:17 +08:00
William Yang 372ea29d96 fix: upgrade code, system mem false alarm 2022-02-23 09:38:54 +01:00
William Yang 841d6d5036 fix: system mem false alarm 2022-02-23 09:14:28 +01:00
JianBo He a2d8405f99 chore: update appup.src 2022-02-22 10:30:52 +08:00
JianBo He b802bcb6fc refactor(exproto): pre-register the anonymous client 2022-02-22 10:23:16 +08:00
JimMoen 31b006a0d1 fix(frame): `server_keepalive` only for MQTT v5.0 2022-02-21 18:46:53 +08:00
Ilya Averyanov 557c52dd8a chore(codestyle): remove Elvis 2022-02-18 20:35:19 +03:00
Thales Macedo Garitezi 3f31df2297
docs: add comment explaining application and release vsn discrepancy 2022-02-14 13:18:53 -03:00
Thales Macedo Garitezi acf3b8cbe9
chore(emqx): update appup 2022-02-14 13:18:07 -03:00
Thales Macedo Garitezi 8302cac329
fix(channel): wrong case clause when alias is inexistent
Fixes #6978 .
2022-02-14 13:18:07 -03:00
Shawn 646ef25d96
Merge branch 'main-v4.3' into fix-ctl-print-43 2022-02-10 19:13:29 +08:00
Shawn 8cf268dffb fix: emqx_message:format/1 failed on undefined message id 2022-02-10 12:43:39 +08:00
Shawn 038136fc83 fix(appup): update appup file for module emqx_message 2022-02-10 11:04:25 +08:00
Shawn 3b5b4b99ed fix(log): format the message id to hexstring before printing 2022-02-10 09:47:33 +08:00
Thales Macedo Garitezi e053700441
style: please elvis checks 2022-02-09 11:02:05 -03:00
Thales Macedo Garitezi 5e223ac64f
chore(appup): update appup files 2022-02-09 09:54:39 -03:00
Thales Macedo Garitezi b968d4c416
fix(ctl): fix formatting when printing messages without arguments (4.3)
Without passing an empty argument list to `emqx_ctl:print`, formatting
instructions like `~n` are being printed literally.

```
Ignore.~nJoin the cluster successfully.~nCluster status: #{running_nodes =>
                      ['emqx@emqx-0.int.thalesmg','emqx@emqx-1.int.thalesmg',
                       'emqx@emqx-2.int.thalesmg','emqx@emqx-3.int.thalesmg',
                       'emqx@emqx-4.int.thalesmg'],
                  stopped_nodes => []}
```
2022-02-09 09:36:27 -03:00
zhongwencool e2dec09b0d fix(alarm): watermark replace >= =< with > < 2022-01-27 11:59:48 +08:00
zhongwencool 9d633507f5 fix(appup): add emqx.erl to appup.src 2022-01-26 14:32:00 +08:00
zhongwencool 78f294cda2 fix: sys_mem alarm is not triggered after reboot. 2022-01-25 16:12:17 +08:00
JianBo He 14538e5f6d chore(emqx): update appup.src 2022-01-21 14:24:01 +08:00
JianBo He c56be7dcd7 refactor(metrics): more clear for acl metrics
For clarity in the meaning of metrics, we put `client.acl.allow`,
`client.acl.deny` into emqx_metrics and increased after a acl checking
returned.
2022-01-21 11:21:25 +08:00
lafirest deada0ea44 chore(appup): update appup file and esockd version 2022-01-18 16:26:01 +08:00
lafirest eb003e3305 feat(emqx_limiter): add support for update overall limiter 2022-01-18 14:06:26 +08:00
zhongwencool 729ab6f60d
Merge branch 'main-v4.3' into auth-mnesia-default-import 2022-01-14 11:29:41 +08:00
zhongwencool ab18020eea
Merge pull request #6736 from zhongwencool/support-license-alarm-type
chore(alarm): support license alarm type
2022-01-14 11:19:48 +08:00
zhongwencool 9a17bcfcc9 chore(appup): update eqmx.appup.src 2022-01-14 11:03:27 +08:00
zhongwencool 7c0d70cfde feat(license): license expriy early alarm. 2022-01-14 00:31:56 +08:00
Shawn 4abcab8d52 fix(appup): update appup files for emqx,emqx_sn,rule_engine 2022-01-13 18:37:22 +08:00
zhongwencool c6a571c207 chore(alarm): support license alarm type 2022-01-13 17:41:16 +08:00
Shawn a6408cee4f fix(session): update testcases for emqx_session 2022-01-13 15:28:18 +08:00
Shawn 9f7f5070b2 fix(channel): update the calls to emqx_session APIs 2022-01-13 13:33:27 +08:00
Shawn 217acc0154 feat(rule): add new event 'delivery_dropped' 2022-01-12 20:11:08 +08:00
Shawn 9434c0fa6c feat(hook): new emqx hook 'delivery.dropped' 2022-01-12 18:34:20 +08:00
JianBo He 02dc216173 chore: update appup.src 2021-12-23 08:48:24 +08:00
JianBo He cb8a3725b4 fix: disconnect the client due to exceed receive-maximum packets
As described in the 5.0 specification, we should disconnect clients that
exceed the receive-maximum limit.

> If it receives more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets
where it has not sent a PUBACK or PUBCOMP in response, **the Server uses a
DISCONNECT packet with Reason Code 0x9**

fix: #6447
2021-12-23 08:48:24 +08:00
Zaiming (Stone) Shi c1cbf39552 fix(appup): add missing beams to emqx.appup.src
also re-formated emqx_sn.appup.src
2021-12-17 13:41:25 +01:00
JimMoen 24060285c5 chore(appup): update appup.src 2021-12-10 18:08:47 +08:00
JimMoen 3ecc79e1bc test(frame): test packet proxy_protocol config disabled 2021-12-10 18:08:47 +08:00
JimMoen b9acf94fd7 feat(frame): better log for proxy_protocol config disabled 2021-12-10 18:08:47 +08:00
Tobias Lindahl 2348e612fa fix(emqx_channel): fix race condition in session takeover
Sessions must not enqueue messages when another process is taking over
the client id, since it already passed on the message queue in the
session state.

Without this fix, messages arriving after `{takeover, 'begin'} to a
channel with no connection (i.e., a persistent session) would be lost.
2021-12-07 16:05:49 +01:00
JimMoen 14aa408b5e style: make elvis happy 2021-12-07 14:17:33 +08:00
JimMoen c5e28bd32b fix(vm): add literal_alloc memory calculation 2021-12-07 14:17:33 +08:00
JianBo He ef6f867304 chore(conn): change terminated print to debug level 2021-12-02 18:01:36 +08:00
Thales Macedo Garitezi 64ce2eea1c
chore(appup): run ./scripts/update_appup.escript to bump vsns 2021-11-25 12:08:02 -03:00
Thales Macedo Garitezi 0260db6640
feat(sys_mon): Add proc_lib:initial_call/1 and current_stacktrace (4.3)
(Same as #6289 )

This adds the information from `proc_lib:initial_call/1` and the
current stacktrace from the process info to `emqx_sys_mon:procinfo/1`
to aid in debugging some warnings with no context such as the
following:

```
2021-11-23T12:33:59.387818+00:00 [warning] info: [{old_heap_block_size,45988046},{heap_block_size,22177879},{mbuf_size,0},{stack_size,40},{old_heap_size,22354134},{heap_size,7106339}], line: 130, mfa: emqx_sys_mon:handle_info/2, msg: large_heap, procinfo: [{pid,<0.2667.0>},{memory,579763664},{total_heap_size,68510672},{heap_size,22177879},{stack_size,40},{min_heap_size,233},{initial_call,{proc_lib,init_p,5}},{current_function,{gen,do_call,4}},{registered_name,[]},{status,running},{message_queue_len,360945},{group_leader,<0.1660.0>},{priority,normal},{trap_exit,false},{reductions,16493271},{last_calls,false},{catchlevel,4},{trace,0},{suspending,[]},{sequential_trace_token,[]},{error_handler,error_handler}]
```
2021-11-25 12:08:02 -03:00
zhouzb 3b25df9b47 fix(appup): fix multiply defined module in appup 2021-11-17 15:18:16 +08:00
zhouzb f948eb927d chore(appup): add appup.src 2021-11-17 14:31:37 +08:00
zhouzb 5e3fe6714e fix(http): fix duplicate http headers 2021-11-17 14:14:12 +08:00
JianBo He 86b8d88165 chore(emqx): update appup.src 2021-11-11 11:55:57 +08:00
JianBo He 8f07f26744 fix: ensure starting listeners before plugins 2021-11-11 11:37:54 +08:00
k32 7d07e8d948 chore(emqx): Update version and appup file 2021-11-08 14:24:37 +01:00
k32 27afecb3ac fix(emqx_connection): Introduce backpressure while sending data
Fixes #5494
2021-11-04 15:25:34 +01:00
JianBo He f36abc281a chore(types): add comment for ver type 2021-11-04 09:11:02 +08:00
JianBo He 2c4d3d1d24 chore(stomp): fix dialyzer warnings 2021-11-02 17:09:57 +08:00
JianBo He 763f567f7d chore(appup): update appup.src 2021-11-01 18:35:41 +08:00
JianBo He c9d39b4d35 chore(channel): remove redundant logs
Multiple sock_closed events may be generated,
so we need to allow sock_closed events to be reentrant
2021-11-01 18:17:38 +08:00
Zaiming Shi fb62487801 fix(emqx/appup): add emqx_cm to appup 2021-10-30 16:39:04 +02:00
Zaiming Shi 7f4809f61a fix(session): force kill session for 'kick' and 'discard'
Prior to this fix, 'kick' and 'discard' calls may timeout (or
fail for other reason), failures lead to only a log, then
continue to allow the new session to get registered.

As a result, in case a client is stuck, there is no way to
force it to step down, end up with multiple connections (sessions)
for the client ID in dashboard.

After this fix, the stale pids are notified to shutdown
via a gen_server:call, and forced with a exit(Pid, kill) for any
exception happend to the gen_server:call
2021-10-30 16:38:36 +02:00
Zaiming Shi 9038da0bd2 fix(ws_connection): check origin failure should return 403 not 500 2021-10-15 15:49:26 +08:00
k32 4643415b0b chore(appup): Update appup scripts 2021-10-12 17:45:10 +02:00
Ilya Averyanov 85723e4a35 fix(emqx_rpc): removed unnecessary call wrapper 2021-10-11 15:20:31 +03:00
Zaiming Shi 7804b39e08 chore(emqx.app): bump emqx app to vsn 4.3.10
app 4.3.9 was release as a part of enterprise e4.3.4
but opensource v4.3.9 is not releasd yet, but we have
to bump app version to 4.3.10 to make appup work for the next
release (either opensource or enterprise).
2021-10-05 12:03:47 +02:00
JimMoen 19031e21ec fix(frame): variable byte integer could be larger than 4 bytes. 2021-09-28 15:15:05 +08:00
k32 9b097ac73f chore(mqueue): Remove forgotten debug message 2021-09-07 11:33:16 +02:00
k32 5fc1036cf7 chore(mqueue): Implement live upgrade 2021-09-06 23:15:14 +02:00
k32 ed61999fdf chore(emqx): Bump version 2021-09-06 22:22:48 +02:00
k32 4eacaa29bd feat(mqueue): Interleave messages with different priorities 2021-09-06 22:22:48 +02:00
Shawn 1245020ec0 fix(force_shutdown): add some comments for the range of max_heap_size 2021-08-13 09:46:49 +08:00
Shawn 844133c7c5 fix(appup): always reload emqx_app 2021-08-13 09:46:49 +08:00
Shawn f9601804e5 chore(emqx): bump the emqx version to 4.3.8 2021-08-13 09:46:49 +08:00
Shawn 31a1942b61 fix(force_shutdown): cannot suicide if the process hangs up 2021-08-13 09:46:49 +08:00
Turtle c45de03ac8 chore(version): update emqx version to 4.3.7
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-05 10:00:03 +08:00
Turtle 87ee94b6f2 chore(version): update emqx version to 4.3.7 2021-08-04 18:44:47 +08:00
JianBo He d3d019cb89 chore(emqx): update appup.src 2021-07-28 13:54:13 +08:00
JianBo He 07c29e8c55 chore(acl): support ipaddr list 2021-07-28 13:54:13 +08:00
Zaiming Shi dd23ee6b15 fix(emqx_app): stop listeners in application prep_stop callback
Application:stop is call after the root supervisor is stopped,
in our case, prior to this fix, emqx_sup is stopped before
the listeners (hence the emqx_connection processes).

This causes shutdown to emit a lot of error logs
e.g. emqx_broker pool is down, but emqx_connection process is still
trying to call the pool
2021-07-28 08:52:04 +08:00
Turtle 5edb5351b0 chore(relup): update emqx appup 2021-07-16 19:01:05 +08:00
JianBo He 46d0cb69dc chore(emqx): update appup.src 2021-07-13 17:53:34 +08:00
JianBo He 240a4b88a5 fix(cm): add a timeout to rpc_call function
An infinite wait will leave the client process waiting for
a return and cause the client to go to a dead state
2021-07-13 17:53:34 +08:00
Shawn 5fbf83e7f0 fix(shared_sub): discard all unexpected msgs 2021-06-28 09:37:34 +08:00
Shawn 513cd001ac chore(appup): update the appup for 4.3.5 2021-06-25 20:38:43 +08:00
Shawn 868cd6e57c fix(shared_sub): failed to clean the emqx_shared_subscription tab
A trick that fixes the issue that we demonitored the shared subscriber
too early if it not unsubscribed all of the topics.
2021-06-25 20:38:43 +08:00
Turtle 1a438125c7 chore(review): review 4.3.4 2021-06-23 17:51:17 +08:00
JianBo He 3ddbdbc6c1
fix(emqx_cm): catch noproc exception from rpc_call (#5048) 2021-06-23 09:45:24 +08:00
JianBo He bbed1b55e0 fix(ws): avoid funcation_clause for un-inited websocket 2021-06-15 11:27:47 +08:00
JianBo He 42a6f2aba5
fix(mqttsn): fix proto_name to MQTT-SN instead of MQTT (#4961) 2021-06-11 11:08:24 +08:00
Turtle eac04b243f fix(relup): fix relup badfun 2021-06-05 02:02:16 +08:00
Zaiming Shi 8bf3c511d8 test: fix a flacky test case 2021-06-04 16:04:58 +02:00
Zaiming Shi 54458e3924 chore(appup): ensure emqx_app alwasy loaded in appup 2021-06-03 13:02:49 +02:00
Tobias Lindahl 981364341e chore(appup): load emqx_channel in appup
Note that the large whitespace diff on the appup file is because this
is the first time the new script for modifying appup files is used.
2021-06-03 12:22:58 +02:00
Tobias Lindahl 90529e18c6 fix: including subscription id keeps correct return code for qos > 0
When subscription id is set, the return code was set to 0 rather than
the provided qos number due to earlier fix of acl check order.
2021-06-03 10:44:13 +02:00
JianBo He 3a89b1f00b
chore(action): fix syntax error (#4885) 2021-05-31 15:08:52 +08:00
Rory-Z 231c800f40 fix(ws connect): fix ws connect with Proxy Protocol capture wrong client-ip 2021-05-27 08:18:34 +00:00
Zaiming Shi 1e2bd2610f feat(emqx_connection): async_set_keepalive defaults to self() 2021-05-27 16:18:17 +08:00
Turtle c02a9f0101 fix(appup): update appup 2021-05-27 13:55:07 +08:00
Zaiming Shi dabf7c66ad fix: external plugin load all
Load all apps in external plugins directory
this is to allow adding other apps as external plugin's dependency
2021-05-27 13:36:57 +08:00
k32 812faf08a1 chore(logger): Update snabbkaffe to 0.13.0 2021-05-25 21:15:59 +02:00
Zaiming (Stone) Shi 37c559a08d
Merge pull request #4858 from zmstone/fix-frame-parse-split-function-clause
fix(emqx_frame): no need to split incoming bytes
2021-05-25 06:57:17 +02:00
Zaiming Shi 1ec3c2d7b9 fix(emqx_node_dump): call atom_to_binary/2
atom_to_binary/1 is added in otp 23,
we still need to support older version
2021-05-25 12:46:47 +08:00
Zaiming Shi 979e495a1e fix(emqx_frame): no need to split incoming bytes
Prior to this commit, there was a bug in emqx_frame:split/2
the tail number of bytes was used for header number of bytes
whens split. As a result, if the tail happens to be longer
then haeder, the parsing state becomes invalid and it crashes
when the next packet arrives

The split was a over-engineered micro-optimization, so it
has been deleted instead of fixed
2021-05-24 21:07:03 +02:00
Zaiming Shi 6701d716dd feat: async API to support tcp keepalive inet options 2021-05-24 19:01:13 +02:00
Zaiming Shi 623ffc7861 fix: add emqx_plugins to appup 2021-05-24 10:45:56 +02:00
Zaiming Shi 4ec1046160 fix: bad test case 2021-05-24 10:45:56 +02:00
Zaiming Shi faecde9ce1 fix(emqx_plugins): allow loading conf for plugin app dir
Prior to this change, plugin config files are only allowed
to be placed in the collective config dir etc/plugins.
In order to support external plugin's drop-in deployment,
this commit made emqx_plugins module to read conf file
in application's etc dir
2021-05-24 10:45:56 +02:00
Zaiming Shi 67245b06b1 chore: make sure emqx_app is reloaded
we bump release version number in emqx_release.hrl for each release
this version is retrieved from emqx_app module, so we must always
reload this module during hot upgrade
2021-05-22 14:56:11 +08:00
Turtle e8790f6e11 fix(mqtt-sn): Fix stop due to keepAlive at sleep mode 2021-05-21 19:22:32 +08:00
Zaiming Shi 4e1798e3f3 fix(emqx_cm): do not log noproc as error
1. websocket call exit with noproc reason.
2. do not capture stacktrace when no need for it
2021-05-19 23:16:11 +02:00
Zaiming Shi dfab9492c6 fix(emqx_connection): do not log einval error
einval happens when trying to send data to a closed socket.
2021-05-18 20:30:27 +08:00
Shawn 97e27faf05
fix(emqx): check if the congestion alarm was sent before clearing (#4824) 2021-05-18 10:34:23 +08:00
Zaiming Shi 5013fb6920 fix(node_dump): obfuscate more secrets 2021-05-17 09:17:29 +02:00
Zaiming Shi ed0ad3e796 chore: skip printing memory 2021-05-14 10:45:58 +02:00
Zaiming Shi 78fd1a80c5 fix(bench): test more publish levels 2021-05-14 10:45:58 +02:00
Zaiming Shi 55316b3ac3 perf: micro optimisation: no lookup for non-wildcard in trie 2021-05-14 10:45:58 +02:00
Zaiming Shi 3c03047c9f fix(emqx_trie): performance issue when many levels 2021-05-14 10:45:58 +02:00
Zaiming Shi 30990edbd4 fix(emqx_broker_bench): test real match performance 2021-05-14 10:45:17 +02:00
Zaiming Shi d0971ceb53 fix: add emqx appup 2021-05-14 10:42:11 +02:00
Zaiming Shi de43da881a fix(emqx_frame): poor large frame concatenation performance
piror to this change, binary concatenation eats most of the CPU
2021-05-13 22:58:22 +02:00
Zaiming Shi 1e3f7319ac fix(emqx_metrics): infinity gen_server call in upgrade 2021-05-13 22:57:44 +02:00
JianBo He c929306cb9 chore(metrics): update ets table in the metrics proc 2021-05-13 22:57:44 +02:00
JianBo He 1ba8d71e7e fix(metrics): set the retained/delayed metrics to counter type
The metrics for messages.* shows the number of times such messages are
received, and it should be a counter rather than a gauge type.
2021-05-12 22:16:14 +08:00
Zaiming Shi 1cabd140c5 fix(logging): add line-break after each JSON log 2021-05-10 12:03:01 +02:00
Zaiming Shi 18cd7e7af5 fix(emqx_logger_jsonfmt): corner test case 2021-05-07 21:25:10 +02:00
Zaiming Shi 05c5378265 feat(http_lib): add normalise_headers API 2021-05-07 10:14:19 +08:00
Zaiming Shi c81cd8550d perf(trie): do not call ets:info/2 to check if table is empty
emqx_trie table is a ordered_set, with write_concurrency set to
true, the counter is not centrialsed, the ets:info/2 call to
check size == 0 is very expensive
2021-05-06 23:27:29 +08:00
Zaiming Shi cfec4c9690 fix(logger): fix json formatter
crash when invalid string as json key.
2021-05-06 15:12:56 +02:00
k32 1db8483bb3 feat(node_dump): Hide `secret' configuration keys
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
2021-05-06 14:19:09 +02:00
k32 e6c85dfb04 fix(node_dump): Attempt to censor passwords 2021-05-06 14:19:09 +02:00
Zaiming Shi 4cff5c4dac chore: fix config doc 2021-05-06 11:03:02 +02:00
Zaiming Shi 6b0487d69d feat(logger): merge metadata to log data 2021-05-06 11:03:02 +02:00
Zaiming Shi 79181072e2 feat(logger): add formatter emqx_logger_jsonfmt 2021-05-06 11:03:02 +02:00
Zaiming Shi 92d3e16d43 perf(router): receive-mark optimise for short-lived transaction process 2021-05-05 11:00:00 +02:00
Zaiming Shi f8700e3f27 fix(emqx_packet): no crash if publish packet has no data 2021-05-04 13:48:35 +02:00
Zaiming Shi bf4baf708a fix(emqx_packet): list element index out of range 2021-05-04 09:24:54 +02:00
Zaiming Shi 171933301a fix(dashboard): display full Erlang/OTP version 2021-04-30 12:26:59 +02:00
William Yang e122ac5716 perf(broker): speedup trans when broker has a big mqueue 2021-04-29 08:52:42 +02:00
William Yang e7fc75fdf2 perf(broker): Optimization for handling bursty traffic
intro. new lock type: 'spawn' of broker.perf.route_lock_type

mnesia get lock calls are not optimized for selective receive.

hence taking locks would be very expensive while there are tones of
messages in the brokers message queue.

This optimization run the transaction in a separate process to utilize
the selective receive optimization of the compiler.
2021-04-28 15:39:46 +02:00
Zaiming Shi 29475eb610 feat(emqx_http_lib): try to parse host ip 2021-04-28 10:43:36 +02:00
Zaiming Shi b688bcfe74 feat(eqmx_misc): add an api to ensure ipv6_probe socket option 2021-04-28 10:43:36 +02:00
Zaiming Shi e54433d342 feat(emqx_vm): add api to inspect which otp version running on 2021-04-28 10:43:36 +02:00
Zaiming Shi d926800204 chore: add emqx_broker_bench.erl 2021-04-26 14:40:39 +02:00
Zaiming Shi cdacaf8694 perf(emqx_trie): use ordered_set 2021-04-26 14:18:40 +02:00
Zaiming Shi b1df759adc refactor(emqx_trie): rename internal function to match_# 2021-04-26 14:18:40 +02:00
Zaiming Shi 8d55d425dc chore(emqx_trie): add test case to cover multiple levels of + wildcards 2021-04-26 14:18:40 +02:00
Zaiming Shi eb946eb80c fix(emqx_trie): do not try to match wildcard topics 2021-04-26 14:18:40 +02:00
Zaiming Shi 22e72cdd82 refactor(emqx_trie): rename record from eqmx_topic to emqx_trie 2021-04-26 14:18:40 +02:00
Zaiming Shi bc6a87946c refactor(emqx_trie): store only prefixes
This commit refactors emqx_trie implementation
with mainly two changes

1. Deleted the edge table.

   In the old implementation, trie consist of nodes and edges.
   e.g. for topic 'a/b/+/d', node 'a' with edge 'b'
   points to node 'a/b' and so on.

   However, edges can be computed at runtime,
   so there is no need to store them in a table.
2021-04-26 14:18:40 +02:00
Zaiming Shi 7128bc9e6e chore(emqx_app): do not print 'starting' log when test 2021-04-26 14:18:40 +02:00
Zaiming Shi 5569c86319 docs(emqx_trie): no doc for internal functions 2021-04-26 14:18:40 +02:00
Zaiming Shi 6be28cecab chore(logging): default to multi-line logging 2021-04-26 11:11:27 +02:00
William Yang 907502fed0
Merge pull request #4645 from qzhuyan/dev/william/fix-issue-2985-c3
fix: issue 2985 attempt 3
2021-04-25 12:39:52 +02:00
Zaiming Shi 708420eb97 fix(emqx_connection): log true stacktrace 2021-04-25 12:01:05 +02:00
Zaiming Shi 2e6ad828a0 chore: remove copyright and license Erlang macros 2021-04-23 20:43:00 +02:00
Zaiming Shi 6354e75626 chore: update copyrights 2021-04-23 20:43:00 +02:00
William Yang 9b13bab2c9 perf: new perf toggle broker.perf.route_lock_type 2021-04-23 13:51:42 +02:00
Zaiming Shi 3547dc4c93 fix(log): client id as string for log metadata
so it does not print <<"...">> to the logs
2021-04-23 06:54:10 +02:00
Zaiming Shi fd69969014 refactor(logging): Log to single line 2021-04-23 06:54:10 +02:00
William Yang 0166bb5a87 fix: broker call should not timeout before client timeout
So change broker call timeout to infinity.
2021-04-21 18:59:46 +02:00
William Yang 17870fdb39 perf(router): add route runs in async dirty context 2021-04-21 18:59:46 +02:00
William Yang 3972a6b435 perf(trie): use global lock
Use global lock to reduce remote lock overhead.

So that emqx route trans can run in dirty *sync* context.

At least 10X subscribe/unsubscribe improvments.
2021-04-21 18:59:24 +02:00
Zaiming Shi 97f2e5d544 test(auth_http): test unset acl_req app env 2021-04-19 08:39:26 +02:00
zhouzb 49502b4e7c feat(uri): add missed function 2021-04-16 20:19:45 +08:00
zhouzb bd1051d1e6 feat(uri): support decoding uri in string 2021-04-16 20:19:45 +08:00
Shawn 4885171e4f fix(emqx): add timeout for open/kick a session 2021-04-15 23:09:58 +08:00
zhanghongtong 446a69c814 fix(ws connection): fix peer_cert_as_username error when ws connect 2021-04-15 09:06:27 +08:00
z8674558 a48e7df4f5 feat(emqx_ws_connection): check http header to know real IP/port 2021-04-14 06:45:39 +00:00
JianBo He 49b7d870e0 fix(modules): load application first for ekka_mnesia scanner 2021-04-13 09:57:33 +08:00
JianBo He 16c999ed9b
Start emqx-modules application by default (#4518)
* fix(modules): start emqx_modules by default

* chore(test): eliminate some compile warnings
2021-04-12 09:45:31 +08:00
Shawn f902d880c1 fix(emqx): rename wont_clear_alarm_in to min_alarm_sustain_duration 2021-04-10 12:17:04 +08:00
Shawn df0e905754 refactor(emqx): the congestion alarm 2021-04-10 12:17:04 +08:00
Shawn 327b0c0995 fix(mqtt_sn): send pingresp until all pubacks received 2021-04-10 09:36:56 +08:00
Yudai Kiyofuji e3a5f65c88
feat(config): print override env (#4517) 2021-04-09 16:28:01 +02:00
Zaiming Shi 7667b65710 fix(emqx): Do not io:format when testing 2021-04-09 10:18:25 +02:00