-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
feat: Adds detection of occupants with no connection. #14146
Conversation
We saw recently two occasions with rooms with participants but no prosody.full_sessions for those participants and when everyone leaves the meeting it never ends.
b6e7996
to
534a64c
Compare
@@ -37,6 +37,8 @@ local tostring = tostring; | |||
-- required parameter for custom muc component prefix, defaults to "conference" | |||
local muc_domain_prefix = module:get_option_string("muc_mapper_domain_prefix", "conference"); | |||
|
|||
local leaked_rooms_since_last_stat = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local leaked_rooms_since_last_stat = 0; | |
local leaked_rooms = 0; |
@@ -49,15 +51,33 @@ function handle_get_room_census(event) | |||
for room in host_session.modules.muc.each_room() do | |||
if not is_healthcheck_room(room.jid) then | |||
local occupants = room._occupants; | |||
local participant_count = 0; | |||
local missing_connections_count = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local missing_connections_count = 0; | |
local missing_connections_count = 0; | |
local current_leaked_rooms = 0; |
local leaked = false; | ||
if participant_count > 0 and missing_connections_count == participant_count then | ||
leaked = true; | ||
leaked_rooms_since_last_stat = leaked_rooms_since_last_stat + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaked_rooms_since_last_stat = leaked_rooms_since_last_stat + 1; | |
current_leaked_rooms = current_leaked_rooms + 1; |
leaked = true; | ||
leaked_rooms_since_last_stat = leaked_rooms_since_last_stat + 1; | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaked_rooms = current_leaked_rooms |
-- we calculate the stats on the configured interval (60 seconds by default) | ||
local measure_leaked_rooms = module:measure('leaked_rooms', 'amount'); | ||
module:hook_global('stats-update', function () | ||
measure_leaked_rooms(leaked_rooms_since_last_stat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
measure_leaked_rooms(leaked_rooms_since_last_stat); | |
measure_leaked_rooms(leaked_rooms); |
local measure_leaked_rooms = module:measure('leaked_rooms', 'amount'); | ||
module:hook_global('stats-update', function () | ||
measure_leaked_rooms(leaked_rooms_since_last_stat); | ||
leaked_rooms_since_last_stat = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaked_rooms_since_last_stat = 0; |
We saw recently two occasions with rooms with participants but no prosody.full_sessions for those participants and when everyone leaves the meeting it never ends.