Skip to content

MIM-2669 Remove ejabberd router - #4695

Merged
bartekgorny merged 5 commits into
masterfrom
remove_ejabberd_router_2
Apr 22, 2026
Merged

MIM-2669 Remove ejabberd router#4695
bartekgorny merged 5 commits into
masterfrom
remove_ejabberd_router_2

Conversation

@bartekgorny

@bartekgorny bartekgorny commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

That module was a leftover, it's been entirely rewritten and had a messy API. This PR fixes all these issues.

Comment thread src/ejabberd_local.erl
T = <<"Local server does not implement this feature">>,
ejabberd_router:route_error_reply(To, From, Acc,
mongoose_xmpp_errors:feature_not_implemented(<<"en">>, T))
{Acc1, Error} = jlib:make_error_reply(Acc,

@bartekgorny bartekgorny Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't really like the way jlib:make_error_reply works, for the following reasons:

  • it makes changes to the accumulator while it is a jlib, it is not supposed to mess with other things
  • if we create a new acc with an error stanza the flag is not set, neither if we just update an acc with such stanza

I'd suggest removing this behaviour and instead check/set the flag in the accumulator when a new element is set (in mongoose_acc:update and update_stanza).

@mongoose-im

mongoose-im commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

CircleCI results for e6a653a


elasticsearch_and_cassandra_latest / elasticsearch_and_cassandra_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 672 / Failed: 0 / User-skipped: 86 / Auto-skipped: 0

mongoose_elasticsearch_SUITE:end_per_suite
{error,
  {{badrpc,
     {'EXIT',
       {#{what => event_already_registered,
        labels => #{pool_tag => default,pool_type => elastic},
        event_name => wpool_global_queue_lengths},
        [{mongoose_instrument,set_up,3,
           [{file,
            "/home/circleci/project/src/instrument/mongoose_instrument.erl"},
          {line,110}]},
         {lists,foreach_1,2,[{file,"lists.erl"},{line,2641}]},
         {mongoose_wpool,start,5,
           [{file,
            "/home/circleci/project/src/wpool/mongoose_wpool.erl"},
          {line,162}]},
         {mongoose_wpool,'-start_configured_pools/3-lc$^1/1-1-',1,
           [{file,
            "/home/circleci/project/src/wpool/mongoose_wpool.erl"},
          {line,129}]},
         {mongoose_wpool,start_configured_pools,1,[]}]}}},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},
       mongoose_wpool,start_configured_pools,
       [[#{scope => global,tag => default,type => elastic,
         opts =>
           #{strategy => best_worker,workers => 10,
           call_timeout => 5000},
         conn_opts => #{port => 9200,host => <<"localhost">>}}]]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1393}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}...

Report log


small_tests_latest / small_tests / 7b161b7
Reports root / small


small_tests_legacy / small_tests / 7b161b7
Reports root / small


small_tests_latest_arm64 / small_tests / 7b161b7
Reports root / small


ldap_mnesia_legacy / ldap_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 2264 / Failed: 0 / User-skipped: 1474 / Auto-skipped: 0


ldap_mnesia_latest / ldap_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 2264 / Failed: 0 / User-skipped: 1474 / Auto-skipped: 0


internal_mnesia_latest / internal_mnesia / 7b161b7
Status: 🔴 Failed
Reports root/ big
OK: 2223 / Failed: 6 / User-skipped: 1277 / Auto-skipped: 232

cluster_commands_SUITE:join_twice_using_rpc
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{timeout => 60000,node => mongooseim2@localhost},
       mongoose_cluster,join,
       [mongooseim@localhost]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {cluster_commands_SUITE,join_twice_using_rpc,1,
      [{file,
         "/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
       {line,296}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1305}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}}

Report log

cluster_commands_SUITE:join_twice_in_parallel_using_rpc
{error,{test_case_failed,wait_for_process_to_stop_timeout}}

Report log

cluster_commands_SUITE:cluster_of_three
{error,
  {{assertEqual,
     [{module,cluster_commands_SUITE},
      {line,357},
      {expression,"OpCode1"},
      {expected,0},
      {value,1}]},
   [{cluster_commands_SUITE,cluster_of_three,1,
      [{file,
         "/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
       {line,357}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1305}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}}

Report log

cluster_commands_SUITE:leave_the_three
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{timeout => 60000,node => mongooseim2@localhost},
       mongoose_cluster,join,
       [mongooseim@localhost]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {cluster_commands_SUITE,leave_the_three,1,
      [{file,
         "/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
       {line,369}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1305}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}}

Report log

cluster_commands_SUITE:remove_dead_from_cluster
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{timeout => 60000,node => mongooseim2@localhost},
       mongoose_cluster,join,
       [mongooseim@localhost]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {cluster_commands_SUITE,remove_dead_from_cluster,1,
      [{file,
         "/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
       {line,388}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1305}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}}

Report log

cluster_commands_SUITE:remove_alive_from_cluster
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{timeout => 60000,node => mongooseim2@localhost},
       mongoose_cluster,join,
       [mongooseim@localhost]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {cluster_commands_SUITE,remove_alive_from_cluster,1,
      [{file,
         "/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
       {line,411}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1305}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}}

Report log

component_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

dynamic_domains_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

graphql_server_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

jingle_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

last_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

local_iq_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

mod_global_distrib_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

persistent_cluster_id_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

s2s_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

service_domain_db_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

service_mongoose_system_metrics_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

shutdown_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log

system_probes_SUITE:init_per_suite
{fail,[{validate_node_failed,mongooseim_not_running,mongooseim2@localhost}]}

Report log


dynamic_domains_mysql_redis_latest / mysql_redis / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5151 / Failed: 0 / User-skipped: 251 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"test type\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


dynamic_domains_pgsql_cets_latest / pgsql_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5187 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"test type\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


dynamic_domains_pgsql_mnesia_legacy / pgsql_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5187 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"test type\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


pgsql_cets_latest / pgsql_cets / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5321 / Failed: 0 / User-skipped: 208 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"localhost\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


dynamic_domains_pgsql_mnesia_latest / pgsql_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5187 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"test type\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


mysql_redis_latest / mysql_redis / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5497 / Failed: 0 / User-skipped: 276 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"localhost\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


pgsql_mnesia_legacy / pgsql_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5504 / Failed: 0 / User-skipped: 269 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"localhost\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


pgsql_mnesia_latest / pgsql_mnesia / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5504 / Failed: 0 / User-skipped: 269 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"localhost\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log


cockroachdb_cets_latest / cockroachdb_cets / 7b161b7
Status: 🟢 Passed
Reports root/ big
OK: 5321 / Failed: 0 / User-skipped: 208 / Auto-skipped: 0

mam_SUITE:end_per_suite
{error,{test_case_failed,"Instrumentation events that were logged, but not tested:\n[{async_pool_queue_lengths,#{host_type => <<\"localhost\">>,\n               pool_id => muc_mam}}]\nYou need to test them with instrument_helper:assert/3"}}

Report log

@codecov

codecov Bot commented Apr 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.69903% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.87%. Comparing base (04c2712) to head (7b161b7).
⚠️ Report is 47 commits behind head on master.

Files with missing lines Patch % Lines
src/muc/mod_muc_room.erl 81.08% 7 Missing ⚠️
src/pubsub/mod_pubsub.erl 63.15% 7 Missing ⚠️
src/jingle_sip/mod_jingle_sip.erl 45.45% 6 Missing ⚠️
src/muc/mod_muc.erl 62.50% 6 Missing ⚠️
src/vcard/mod_vcard.erl 54.54% 5 Missing ⚠️
src/ejabberd_local.erl 20.00% 4 Missing ⚠️
src/mongoose_router.erl 84.61% 4 Missing ⚠️
src/component/mongoose_component_connection.erl 33.33% 2 Missing ⚠️
src/mod_presence.erl 89.47% 2 Missing ⚠️
src/mod_register.erl 50.00% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4695      +/-   ##
==========================================
+ Coverage   85.77%   85.87%   +0.09%     
==========================================
  Files         551      550       -1     
  Lines       33180    33167      -13     
==========================================
+ Hits        28461    28482      +21     
+ Misses       4719     4685      -34     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bartekgorny
bartekgorny force-pushed the remove_ejabberd_router_2 branch from e6a653a to 52bafb3 Compare April 2, 2026 13:49
@bartekgorny
bartekgorny force-pushed the remove_ejabberd_router_2 branch from f8f4795 to b44067e Compare April 8, 2026 15:51
@bartekgorny bartekgorny changed the title Remove ejabberd router 2 MIM-2669 Remove ejabberd router Apr 8, 2026
@bartekgorny
bartekgorny marked this pull request as ready for review April 20, 2026 11:50

@chrzaszcz chrzaszcz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good 👍 - I added minor comments.

Comment thread big_tests/tests/muc_SUITE.erl Outdated
Comment thread big_tests/tests/muc_SUITE.erl Outdated
Comment thread big_tests/tests/muc_SUITE.erl Outdated
Comment thread big_tests/tests/muc_SUITE.erl Outdated
Comment thread big_tests/tests/muc_SUITE.erl Outdated
Comment thread src/muc/mod_muc_room.erl Outdated
Comment thread src/muc/mod_muc_room.erl Outdated
Comment thread src/roster/mod_roster.erl Outdated
Comment thread src/mod_register.erl Outdated
Comment thread test/acc_SUITE.erl Outdated
@bartekgorny
bartekgorny force-pushed the remove_ejabberd_router_2 branch from 7e376ec to 7b161b7 Compare April 22, 2026 09:40

@chrzaszcz chrzaszcz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👌

@bartekgorny
bartekgorny merged commit cdcd213 into master Apr 22, 2026
4 of 6 checks passed
@bartekgorny
bartekgorny deleted the remove_ejabberd_router_2 branch April 22, 2026 13:02
@kamilwaz kamilwaz mentioned this pull request Apr 23, 2026
@kamilwaz kamilwaz added this to the 6.7.0 milestone May 11, 2026
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