Ejabberd: mod_last does not update timestamp and state on restart

Created on 9 Jul 2021  路  1Comment  路  Source: processone/ejabberd

Environment

  • ejabberd version: 21.04
  • Erlang version:10.6.4
  • OS: Linux (openSUSE)
  • Installed from: distro package
  • Database: mariadb

Bug description

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:

  • they are permanently online
  • I once set their state manually with 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.

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:

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).

>All comments

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).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgg picture lgg  路  4Comments

haegar picture haegar  路  4Comments

Vshnv picture Vshnv  路  4Comments

BoopathyRaja picture BoopathyRaja  路  3Comments

kabirhaxor picture kabirhaxor  路  3Comments