Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_last does not update timestamp and state on restart #3641

Closed
Millesimus opened this issue Jul 9, 2021 · 1 comment
Closed

mod_last does not update timestamp and state on restart #3641

Millesimus opened this issue Jul 9, 2021 · 1 comment

Comments

@Millesimus
Copy link

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.

@badlop
Copy link
Member

badlop commented Jul 28, 2021

Update: After more testing, sometimes it's the mysql account the one that gets properly closed, not the mnesia one. Other times, none of them is properly closed... and sometimes both of them are. I couldn't find any way to reproduce or control or detect when, why or how does that happen.


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

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

No branches or pull requests

2 participants