processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/ejabberd/
Other
6.12k stars 1.51k forks source link

Error with mod_muc_rtbl when restarting server #4260

Closed poVoq closed 4 months ago

poVoq commented 4 months ago

Environment

Errors from error.log/crash.log

ejabberdctl[3783078]: 13:30:39.730 [error] Failed to stop module mod_muc_rtbl at example.org:
ejabberdctl[3783078]: ** exception exit: {{nodedown,'mod_muc_rtbl_example.org'},
ejabberdctl[3783078]:                   {sys,terminate,
ejabberdctl[3783078]:                        [{local,'mod_muc_rtbl_example.org'},normal,infinity]}}
ejabberdctl[3783078]:    in function  proc_lib:stop/3 (proc_lib.erl, line 1142)
ejabberdctl[3783078]:    in call from gen_mod:stop_module_keep_config/2 (src/gen_mod.erl, line 328)
ejabberdctl[3783078]:    in call from lists:foreach_1/2 (lists.erl, line 1686)
ejabberdctl[3783078]:    in call from gen_mod:stop/0 (src/gen_mod.erl, line 116)
ejabberdctl[3783078]:    in call from ejabberd_app:prep_stop/1 (src/ejabberd_app.erl, line 107)
ejabberdctl[3783078]:    in call from application_master:prep_stop/2 (application_master.erl, line 397)
ejabberdctl[3783078]:    in call from application_master:loop_it/4 (application_master.erl, line 373)

Bug description

Doesn't seem to have any practical impact, but the error is probably worth looking into. Seems to be newly introduced in 24.07 (or maybe 24.06, but I didn't notice it there).

badlop commented 4 months ago

It's a small bug when the stop/1 function calls gen_server:stop/1. It should provide the process name:

  • LocalName - The gen_server is locally registered as LocalName with register/2.
  • {Name,Node} - The gen_server is locally registered on another node.

But we provide a tuple with two elements, and it gets confused with {Name, Node}

I'll commit a fix.