Skip to content

MIM-2766 Fix mod ping intervals - #4761

Merged
chrzaszcz merged 4 commits into
masterfrom
fix-mod-ping-intervals
Aug 4, 2026
Merged

chrzaszcz merged 4 commits into
masterfrom
fix-mod-ping-intervals

Conversation

@chrzaszcz

@chrzaszcz chrzaszcz commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Fix mod_ping so server-to-client pings are sent after the configured ping_interval with ping_req_timeout used only for waiting for the client response.

  • The previous behaviour was buggy: there was one unnecessary wait, and timeout reset during the second wait was also missing.
  • Remove the obsolete active_keep_alive test, since whitespace keepalive no longer resets the ping timer and is not part of XEP-0199 behavior. This test was passing only because of the bug. The tested functionality has been long gone from MIM (since mongoose_c2s).
  • Remove ambiguity around mod_ping in docs.

niecore and others added 2 commits March 11, 2026 11:59
The current implementation does not match the documentation.
Following configuration options are available `ping_interval`
and `ping_req_timout`. The expectation would be that a
server to client ping is send after `ping_interval` seconds
after the last user activity and then the user has `ping_req_timeout`
seconds to answer the ping. But the ping is only sent after
`ping_interval` + `ping_req_timeout` This change removes the additional
timer for `ping_req_timeout`.
Send pings with correct interval in `mod_ping`
@mongoose-im

mongoose-im commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

CircleCI results for 52f8073


small_tests_legacy / small_tests / ee2b2ba
Reports root / small


small_tests_latest / small_tests / ee2b2ba
Reports root / small


small_tests_latest_arm64 / small_tests / ee2b2ba
Reports root / small


ldap_mnesia_latest / ldap_mnesia / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 2324 / Failed: 0 / User-skipped: 1567 / Auto-skipped: 0


internal_mnesia_latest / internal_mnesia / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 2473 / Failed: 0 / User-skipped: 1418 / Auto-skipped: 0


dynamic_domains_pgsql_cets_legacy / pgsql_cets / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5185 / Failed: 0 / User-skipped: 237 / Auto-skipped: 0


dynamic_domains_pgsql_cets_latest / pgsql_cets / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5185 / Failed: 0 / User-skipped: 237 / Auto-skipped: 0


elasticsearch_and_cassandra_mnesia_latest / elasticsearch_and_cassandra_mnesia / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 3142 / Failed: 0 / User-skipped: 1444 / Auto-skipped: 0

mongoose_elasticsearch_SUITE:end_per_suite
{error,
  {{badrpc,
     {'EXIT',
       {#{what => event_already_registered,
        event_name => wpool_global_queue_lengths,
        labels => #{pool_type => elastic,pool_tag => default}},
        [{mongoose_instrument,set_up,3,
           [{file,
            "/home/circleci/project/src/instrument/mongoose_instrument.erl"},
          {line,114}]},
         {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,1799}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1396}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1240}]}]}...

Report log


pgsql_cets_legacy / pgsql_cets / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5506 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


pgsql_cets_latest / pgsql_cets / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5506 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


pgsql_mnesia_latest / pgsql_mnesia / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5620 / Failed: 0 / User-skipped: 344 / Auto-skipped: 0


pgsql_redis_latest / pgsql_redis / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5586 / Failed: 0 / User-skipped: 378 / Auto-skipped: 0


mysql_cets_latest / mysql_cets / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5504 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0


cockroachdb_cets_latest / cockroachdb_cets / ee2b2ba
Status: 🟢 Passed
Reports root/ big
OK: 5506 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0

@codecov

codecov Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.95%. Comparing base (5ab1af7) to head (ee2b2ba).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4761      +/-   ##
==========================================
- Coverage   86.98%   86.95%   -0.03%     
==========================================
  Files         554      554              
  Lines       33597    33593       -4     
==========================================
- Hits        29223    29212      -11     
- Misses       4374     4381       +7     

☔ View full report in Codecov by Harness.
📢 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.

This test was checking the support for legacy "whitespace ping",
but it was only passing because of a bug (double timeout).
The support for whitespace ping has been long gone.
@chrzaszcz
chrzaszcz marked this pull request as ready for review August 3, 2026 15:19
@chrzaszcz chrzaszcz changed the title Fix mod ping intervals MIM-2766 Fix mod ping intervals Aug 3, 2026

@telezynski telezynski 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

@chrzaszcz
chrzaszcz merged commit 0fc6c84 into master Aug 4, 2026
4 checks passed
@chrzaszcz
chrzaszcz deleted the fix-mod-ping-intervals branch August 4, 2026 08:00
@mdbrnowski mdbrnowski added this to the 6.8.0 milestone Aug 4, 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.

5 participants