emqx/test
Thales Macedo Garitezi d435f1211e
fix(live_conn): fix live connection count on race condition
When multiple clients try to connect concurrently using the same
client ID, they all call `emqx_channel:ensure_connected`, increasing
the live connection count, but only one will successfully acquire the
lock for that client ID.  This means that all other clients that
increased the live connection count will not get to call neither
`emqx_channel:ensure_disconnected` nor be monitored for `DOWN`
messages, effectively causing a count leak.

By moving the increment to `emqx_cm:register_channel`, which is only
called inside the lock, we can remove this leakage.

Also, during the handling of `DOWN` messages, we now iterate over all
channel PIDs returned by `eqmx_misc:drain_down`, since it could be
that one or more PIDs are not contained in the `pmon` state.
2021-12-08 10:33:57 -03:00
..
emqx_SUITE_data Revert "refactor(emqx_modules): Move modules config to app dir" 2021-02-11 16:44:12 +01:00
emqx_access_SUITE_data refactor(apps): Merge emqx_libs back to emqx 2020-12-04 19:58:58 +01:00
emqx_plugins_SUITE_data/emqx_mini_plugin fix(emqx_plugins): allow loading conf for plugin app dir 2021-05-24 10:45:56 +02:00
props chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_access_control_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_access_rule_SUITE.erl chore(acl): support ipaddr list 2021-07-28 13:54:13 +08:00
emqx_acl_cache_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_acl_test_mod.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_alarm_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_banned_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_batch_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_boot_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_broker_SUITE.erl fix(live_conn): fix live connection count on race condition 2021-12-08 10:33:57 -03:00
emqx_broker_helper_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_channel_SUITE.erl Merge branch 'main-v4.3' into sync-from-4.3 2021-12-07 23:20:01 +08:00
emqx_client_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_cm_SUITE.erl test(emqx_cm_SUITE): add a gen_server call sync 2021-11-11 10:33:31 +01:00
emqx_cm_locker_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_cm_registry_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_connection_SUITE.erl feat(stats): track live / connected channel count for monitoring 2021-11-08 14:45:57 -03:00
emqx_ctl_SUITE.erl chore(version): update emqx version to 4.3.7 2021-08-05 10:00:03 +08:00
emqx_flapping_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_frame_SUITE.erl chore(test): variable integer test. 2021-09-28 15:15:05 +08:00
emqx_gc_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_global_gc_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_guid_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_hooks_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_http_lib_tests.erl Sync v4.3 to v4.4 (#6262) 2021-11-23 09:33:20 +08:00
emqx_inflight_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_json_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_keepalive_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_limiter_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_listeners_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_logger_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_message_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_metrics_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_misc_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_mountpoint_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_mqtt_SUITE.erl fix(test): flaky mqtt expiry test case. (#6111) 2021-11-10 15:41:31 +08:00
emqx_mqtt_caps_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_mqtt_props_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_mqtt_protocol_v5_SUITE.erl test: fix a flacky test case 2021-06-04 16:04:58 +02:00
emqx_mqueue_SUITE.erl feat(stats): track live / connected channel count for monitoring 2021-11-08 14:45:57 -03:00
emqx_os_mon_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_packet_SUITE.erl fix(emqx_packet): no crash if publish packet has no data 2021-05-04 13:48:35 +02:00
emqx_passwd_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_pd_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_plugins_SUITE.erl chore(typo): sepecial -> special 2021-05-24 10:45:56 +02:00
emqx_pmon_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_pool_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_pqueue_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_reason_codes_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_request_handler.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_request_responser_SUITE.erl chore: more copyright updates 2021-04-23 20:43:00 +02:00
emqx_request_sender.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_router_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_router_helper_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_sequence_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_session_SUITE.erl refactor(emqx_slow_subs): refactor use moving average (#6287) 2021-11-26 10:42:15 +08:00
emqx_shared_sub_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_stats_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_sup_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_sys_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_sys_mon_SUITE.erl feat(sys_mon): Add proc_lib:initial_call/1 and current_stacktrace (4.3) 2021-11-25 12:08:02 -03:00
emqx_tables_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_takeover_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_tls_lib_tests.erl fix(eunit): fix emqx_tls_lib_tests 2021-03-01 21:00:17 +08:00
emqx_topic_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_trace_handler_SUITE.erl fix: trace_name format [A-Za-z0-9-_];waiting status if create time to closed" 2021-12-06 20:51:42 +08:00
emqx_trace_handler_tests.erl refactor(trace): hash non-printable or too long names 2021-11-22 16:59:17 +01:00
emqx_trie_SUITE.erl perf: micro optimisation: no lookup for non-wildcard in trie 2021-05-14 10:45:58 +02:00
emqx_vm_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_vm_mon_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00
emqx_ws_connection_SUITE.erl feat(stats): track live / connected channel count for monitoring 2021-11-08 14:45:57 -03:00
emqx_zone_SUITE.erl chore: update copyrights 2021-04-23 20:43:00 +02:00