Skip to content
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

Prevent infinite loop when domain isolation is on on both domains #3110

Merged
merged 1 commit into from
May 6, 2021

Conversation

arcusfelis
Copy link
Contributor

This PR addresses MIM-1395.

Proposed changes include:

  • Fixes "Domain isolation causes an infinite loop".
  • A test.

Description:
Step to reproduce:

Enable domain isolation for two domains, e.g.: `localhost`, `localhost.bis`

Send any message between the two domains, e.g. from `alice@localhost.bis` (A) to `bob@localhost` (B)

mod_domain_isolation handles message from A to B by sending an error reply from B to A, which in turn results in an error reply etc... error elements are accumulating forever in the packet (actually: until the hook timeout passes), eating memory and time.

Add test to domain_isolation_SUITE, fix the issue by not bouncing the error message back.

@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #3110 (9d531fe) into master (3d3ff8d) will increase coverage by 0.04%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3110      +/-   ##
==========================================
+ Coverage   79.18%   79.23%   +0.04%     
==========================================
  Files         387      387              
  Lines       31853    31861       +8     
==========================================
+ Hits        25224    25245      +21     
+ Misses       6629     6616      -13     
Impacted Files Coverage Δ
src/mod_domain_isolation.erl 94.28% <90.00%> (-2.02%) ⬇️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 71.69% <0.00%> (-1.89%) ⬇️
src/global_distrib/mod_global_distrib_utils.erl 65.09% <0.00%> (-0.95%) ⬇️
...c/global_distrib/mod_global_distrib_server_mgr.erl 76.83% <0.00%> (-0.57%) ⬇️
src/ejabberd_c2s.erl 89.13% <0.00%> (-0.08%) ⬇️
src/mod_muc_log.erl 77.72% <0.00%> (ø)
src/mod_roster.erl 76.79% <0.00%> (+0.23%) ⬆️
src/ejabberd_sm.erl 82.71% <0.00%> (+0.33%) ⬆️
src/wpool/mongoose_wpool.erl 85.00% <0.00%> (+1.00%) ⬆️
src/mam/mod_mam_elasticsearch_arch.erl 88.39% <0.00%> (+1.78%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d3ff8d...9d531fe. Read the comment docs.

@arcusfelis arcusfelis force-pushed the mu-isolation_works_for_one2one_2domains branch from 553f528 to 9d531fe Compare May 6, 2021 08:33
Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good

@chrzaszcz chrzaszcz merged commit 9557370 into master May 6, 2021
@chrzaszcz chrzaszcz deleted the mu-isolation_works_for_one2one_2domains branch May 6, 2021 10:09
@Premwoik Premwoik added this to the 5.0.0 milestone Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants