Last logouts are not recorded when server is shut down
Description
Environment
is related to
Activity

csh March 7, 2014 at 7:39 PM
@Gaston: I've implemented your suggestion. Can you review?
Guus der Kinderen February 6, 2013 at 7:57 PM
Removing the 'fix version' for all unresolved issues that were scheduled for version 7.8.2. We're releasing this version today - the remaining issues should be rescheduled later.

Gaston Dombiak January 24, 2008 at 6:14 AM
XMPPServer#shutdownServer is executed when shutting down the server which in turn stops the server's modules. When the RoutingTableImpl module is stopped it will disconnect clients connected to that JVM only and it sends the stream error condition system-shutdown. That is how all connected clients get disconnected.
Before disconnecting the clients presences of users are not updated (which makes sense for performance reason). However the consequence of this is that the logic in PresenceUpdateHandler#process is never triggered thus the code in PresenceManagerImpl#userUnavailable is never reached so logout timestamp is never stored in the database.
An option to solve this problem in an efficient way to to change PresenceManagerImpl to implement the XMPPServerListener interface and listen to the event of shutdown. This event is triggered before modules are stopped. The PresenceManagerImpl can then update the log out time for each connected user to that JVM.
It you shut down the server, the last logout information for users is never updated.