-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(emqx_cm): use a dedicated pool for channel cleanup #12336
perf(emqx_cm): use a dedicated pool for channel cleanup #12336
Conversation
7e4b5f6
to
f70f834
Compare
async_submit_to_pool(?POOL, Fun, Args). | ||
|
||
-spec submit_to_pool(any(), task()) -> any(). | ||
submit_to_pool(Pool, Task) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: added a new function with a distinct name to avoid having different semantics under the same function arity, which would look quite messy, e.g.:
async_submit(Fun, Args) when is_function(Fun) ->
async_submit(?POOL, Fun, Args);
async_submit(Pool, Task) ->
...
@@ -353,10 +353,12 @@ test_stepdown_session(Action, Reason) -> | |||
%% to sync with the pool workers. | |||
%% The number of tasks should be large enough to ensure all workers have | |||
%% the chance to work on at least one of the tasks. | |||
flush_emqx_pool() -> | |||
flush_emqx_cm_pool() -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this seems almost identical to emqx_pool:flush_async_tasks/1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, replaced it with `emqx_pool:flush_async_tasks/1, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, failed to push this fix 🙈 , will issue a follow-up PR..
This is to isolate channels cleanup from other async tasks (like routes cleanup), as channels cleanup can be quite slow under high network latency conditions. Fixes: EMQX-11743
f70f834
to
b472b56
Compare
This is to isolate channels cleanup from other async tasks (like routes cleanup), as channels cleanup can be quite slow under high network latency conditions.
Fixes EMQX-11743
Release version: v/e5.?
Summary
PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update