Skip to content

Conversation

keynslug
Copy link
Contributor

@keynslug keynslug commented Jun 17, 2025

Addresses #14011.

Release version: 5.10.1?

Summary

Server emqx_shared_sub manages its own monitors and runs cleanups. Moreover, during high disconnect rate it can be overloaded with DOWN signals, and unsubscribe/3 call can easily timeout.

PR Checklist

  • For internal contributor: there is a jira ticket to track this change
  • The changes are covered with new or existing tests
  • Change log for changes visible by users has been added to changes/ee/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • Schema changes are backward compatible

Server `emqx_shared_sub` manages its own monitors and runs cleanups.
Moreover, during high disconnect rate it can be overloaded with
DOWN signals, and `unsubscribe/3` call can easily timeout.
@codecov-commenter
Copy link

codecov-commenter commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.79%. Comparing base (684161a) to head (9a768de).
Report is 17 commits behind head on release-510.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-510   #15396      +/-   ##
===============================================
+ Coverage        81.74%   81.79%   +0.04%     
===============================================
  Files             1116     1117       +1     
  Lines            81434    81549     +115     
===============================================
+ Hits             66572    66704     +132     
+ Misses           14862    14845      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@keynslug keynslug marked this pull request as ready for review June 18, 2025 14:38
@keynslug keynslug requested a review from a team as a code owner June 18, 2025 14:38
do_unsubscribe_down(Topic, SubPid, SubOpts) ->
true = ets:delete(?SUBOPTION, {Topic, SubPid}),
case Topic of
B when is_binary(B) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe add a IS_SHARED_TOPIC macro in emqx_mqtt.hrl.

Copy link
Contributor Author

@keynslug keynslug Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep most common case clauses first, I guess then we'd then need IS_REGULAR_TOPIC, which is just is_binary(X)?

@@ -210,24 +210,23 @@ unsubscribe(Topic) when ?IS_TOPIC(Topic) ->
do_unsubscribe(Topic, SubPid, SubOpts) ->
true = ets:delete(?SUBOPTION, {Topic, SubPid}),
true = ets:delete_object(?SUBSCRIPTION, {SubPid, Topic}),
do_unsubscribe2(Topic, SubPid, SubOpts).
case Topic of
B when is_binary(B) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe add a IS_SHARED_TOPIC macro in emqx_mqtt.hrl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to make it look nicer in the followup PRs.

@keynslug keynslug merged commit b5b695e into emqx:release-510 Jun 23, 2025
151 checks passed
@keynslug keynslug deleted the fix/GHD-14011/no-dup-dead-shared-unsub branch June 23, 2025 08:00
@emqxqa
Copy link

emqxqa commented Jul 7, 2025

TestExecution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants