Merge pull request #380 from matrix-org/kegan/log-state-invalidate

Log information about the invalidated room
This commit is contained in:
kegsay 2023-11-21 10:33:47 +00:00 committed by GitHub
commit a8fb526261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -874,6 +874,10 @@ func (h *SyncLiveHandler) OnInvalidateRoom(p *pubsub.V2InvalidateRoom) {
if h.destroyedConns != nil {
h.destroyedConns.Add(float64(destroyed))
}
// invalidations are rare and dangerous if we get it wrong, so log information about it.
logger.Info().
Str("room_id", p.RoomID).Int("joins", len(joins)).Int("invites", len(invites)).Int("leaves", len(leaves)).
Int("del_user_caches", len(unregistered)).Int("conns_destroyed", destroyed).Msg("OnInvalidateRoom")
}
func parseIntFromQuery(u *url.URL, param string) (result int64, err *internal.HandlerError) {