Skip to content

Fix incorrect reference start time for reclaiming session timeout#3643

Open
lminiero wants to merge 1 commit into
masterfrom
reclaim-timer
Open

Fix incorrect reference start time for reclaiming session timeout#3643
lminiero wants to merge 1 commit into
masterfrom
reclaim-timer

Conversation

@lminiero
Copy link
Copy Markdown
Member

This PR is an attempt to address the issue reported on the group, about a broken behaviour of our reclaim session functionality. As per the documentation, if a reclaim session timeout is configured, when a transport goes away you have X seconds to try and restore it from a different transport: the code was using the last activity as a start for the timeout, though, which was incorrect, since the last activity may precede the time we detect a transport to be gone, in some cases preventing any chance to reclaim due to early cleanups. This PR introduces a new timer that we track when the transport actually is detected as gone, and that we use in the related check.

Not tested yet, so please provide feedback on whether this works correctly and/or if it causes regressions.

@oleksandr-mihal-zultys
Copy link
Copy Markdown
Contributor

I will test on 0.16.2 version

@lminiero
Copy link
Copy Markdown
Member Author

I will test on 0.16.2 version

You'll need to port the fix to 0.x, then, as this PR is for master.

@oleksandr-mihal-zultys
Copy link
Copy Markdown
Contributor

Works as expected.

session_timeout = 90
reclaim_session_timeout = 30

Last keep-alive:
[Tue May 12 05:45:21 2026] Got a keep-alive on session 74361634286954

LTE is turned OFF -> connection is closed:

[Tue May 12 05:45:45 2026] [WARN] [4893513815967762] Didn't receive audio for more than 1 seconds...
[Tue May 12 05:45:45 2026] [4893513815967762] Notifying that we are NOT receiving audio
[Tue May 12 05:45:45 2026] [4893513815967762] Sending event to transport...
[Tue May 12 05:45:45 2026] [WSS-0x7f5db0001dc0] WS connection down, closing
[Tue May 12 05:45:45 2026] [WSS-0x7f5db0001dc0] Destroying WebSocket client
[Tue May 12 05:45:45 2026] A janus.transport.websockets transport instance has gone away (0x7f5db0026a30)
[Tue May 12 05:45:45 2026]   -- Session 74361634286954 will be over if not reclaimed
[Tue May 12 05:45:45 2026]   -- Marking Session 74361634286954 as over
[Tue May 12 05:45:45 2026] [WSS-0x7f5db0001dc0]   -- closed

Connection is restored:

[Tue May 12 05:46:01 2026] [WSS-0x7f5db0002610] WebSocket connection opened from 127.0.0.1
[Tue May 12 05:46:01 2026] [WSS-0x7f5db0002610] WebSocket connection accepted
[Tue May 12 05:46:01 2026] [WSS-0x7f5db0002610]   -- Ready to be used!

Call is complete.
[Tue May 12 05:46:08 2026] Destroying session 74361634286954; 0x7f5de0005890

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

Successfully merging this pull request may close these issues.

2 participants