Disable session expiration

Hi,

I recently upgraded out instance to .16 from .11 and I am seeing a different behavior with the way sessions expire. We generate invite links for calls and send them via email, sometimes we schedule them for the future say tomorrow at 11 am and we send out a link with a token. the problem is by the next day when they use it its expired.

I have tried setting the garbage collector values to 0 but this doesn’t seem to have helped. I am noticing that if a participant joins and leaves the other participants cant join as the session has expired.

Is there a way I can add a long limit to session timeouts for all calls? Say a week or month?

Nothing has changed with respect to the close up process of sessions when the last connected user leaves it. If a Session is created and a Connection initialized, and its token used by a final user to connect to it (Connection property “status” to “active”), then that Sesson will be subject to automatic close up when the last user disconnects. This has always been like this.

The empty session garbage collector process you mentioned is actually new from version 2.11.0. It simply automatically closes all the inactive Sessions. Inactive Sessions are those fo which no final user has connected to it. It runs every 15 minutes by default, removing Sessions (and all their Connections/tokens) that have been more than 1 hour in this “inactive” status. It can be disabled setting it to OPENVIDU_SESSIONS_GARBAGE_INTERVAL=0. Or you can modify the amount of time that a Session must remain inactive to be removed with OPENVIDU_SESSIONS_GARBAGE_THRESHOLD=0. That is working fine, but you must take into account the behavior I described in the first paragraph.

Regards.

I just did another test, I generated 2 tokens at 4:30 and tried to use them now at 7:30 and they had expired. I get error 202 session could not be found. I have both the garbage variables set to 0 in my .env file. I am not sure what else i can do?

I just confirmed again that we are seeing these issues with 0 set for OPENVIDU_SESSIONS_GARBAGE_INTERVAL and OPENVIDU_SESSIONS_GARBAGE_THRESHOLD set to 32 million. It seems like this is a bug. Can you advise anything else we can try?

The session created at 730 last night were expired at 830 this morning.

I can confirm that config api is returing

“openvidU_SESSIONS_GARBAGE_INTERVAL”: 900,
“openvidU_SESSIONS_GARBAGE_THRESHOLD”: 3600,

Its ignoring my .env file it would seem?

Did you restarted openvidu with:

./openvidu restart

Yeah I have actually rebooted the server several times, once after each config change

Can you show the content of your .env file?

Also show the content of:

./openvidu version

I have just managed to fix it, I noticed that even when I changed other variables they were not being honors. the weird thing is that all of my custom recording layouts were being remembered, as were my port and DNS settings. I updated the docker-compose file to include the full path to the env and not just .env and now its picking up changes. Cabn you confirm where it might have been reading before this?

The .env file should be next to the docker-compose file. That’s why I want to now the output of:

./openvidu version

It shows your directory hierarchy in /opt/openvidu and I can see if you have all files corretly placed.

If you have your .env file next to the docker-compose, I don’t understand why it was not loading before.