I would expect ejabberdctl restart to result in updates of timestamp and state column in table "last". However, I have some accounts whose rows appear never to be updated; not even on restarts. Characteristics of these accounts are:
ejabberdctl set_last to prevent deletion by a ejabberdctl --no-timeout delete_old_users_vhost cron (which is how I got aware of this issue)Kicking a user('s session) results in the expected row update.
It works correctly when using Mnesia storage: when ejabberd is stopping, it closes the c2s sessions gracefully, mod_last has a chance to store information, and this is logged:
2021-07-28 19:10:57.727012+02:00 [info] (tls|<0.581.0>)
Closing c2s session for user2@localhost/tka1:
Stream closed by local host: system-shutdown
The problem appears when using MySQL storage (in my tests): the c2s sessions are not closed gracefully. I could reproduce that problem in all the ejabberd versions I tried (20.07 21.01 21.04 21.07).
Most helpful comment
It works correctly when using Mnesia storage: when ejabberd is stopping, it closes the c2s sessions gracefully, mod_last has a chance to store information, and this is logged:
The problem appears when using MySQL storage (in my tests): the c2s sessions are not closed gracefully. I could reproduce that problem in all the ejabberd versions I tried (20.07 21.01 21.04 21.07).