-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
HTTP Long-poll still causing timeouts #2520
Comments
You have not misread the docs, everything should work as intended. |
Also are you able to replicate in a local setup ? |
@atoppi thank you for the quick reply. After looking at it with my coworker, it seems like it was an authentication issue on the GET requests (we were seeing some 403s on Janus logs). This line in the docs explains what I should have done:
I was originally passing the API secret like this (Node.js + axios): axios.get(url, { apisecret: 'foo' }) This seems to fix it: axios.get(url + '?apisecret=foo', data); However, even though this fixed it, the fact that the requests were working before that (I was able to receive offers and answers from Janus and pass them to the clients) seems to indicate that there is a bug within Janus itself. Maybe it read the API secret and responded but didn't update the |
No bug: if you provide the wrong apisecret, or don't provide it at all, the request never gets to the core, but stays in the transport (where you get the 403). Since it doesn't reach the core, it doesn't count as activity that can reset the last activity flag. |
Oh I think I see what you mean: you were indeed getting a response to (some?) long polls, even though the API secret was passed the wrong way, and so the transport shouldn't have had access to it. The face you see 403s seems to suggest it rejected at least some of them. I'll have to check if there are instances where the long poll may be done even when the API secret isn't correctly provided (which shouldn't happen). For requests where you did get events, those did reset the last activity counter. |
I don't think I actually ever saw a 403 coming back to me (I don't remember the job failing at all). I only ever saw 403s in the Janus logs, but I don't think I received them. |
Yes, that's what should happen, this is the code where we do that for long polls: You can try adding some manual log lines to the |
Wait, looking at the code I think I know what may be happening... these are the checks:
The |
Thank you, I will try that later (will have to figure out how to compile from OSX). I believe an easy test setup will be:
|
I'm looking at the code right now, and I believe you are correct. gboolean janus_transport_is_auth_token_valid(janus_transport *plugin, const char *token) {
if(!janus_auth_is_enabled())
return TRUE;
return token && janus_auth_check_token(token);
} which will cause the condition to be falsy. Will still double check later and submit a PR if I manage to compile it :) |
Closing as I just merged the PR. Thanks! |
I'm currently building a signaling server that acts as an intermediate between clients and Janus. The server has a connection-poll job queue that queries the session ID/plugin handle until it gets a 404. If it gets a 200, it runs the same job again. This part is working, I'm able to send and receive audio/video to/from Janus.
However, it seems like Janus incorrectly detects session timeouts. The session timeouts are set to the default 60 seconds, and my polling job is querying the endpoints much more often than that (at least once every 30 seconds).
After 60 seconds, even though I am still polling the connection, Janus closes the session automatically.
Reading the docs, I believe there should be no timeout:
I'm using
v0.10.9
and the video room plugin on an Ubuntu VM on gcloud, but have seen similar results within docker-compose on an older version.This seems like a bug, but I'm wondering if I'm misreading the docs.
The text was updated successfully, but these errors were encountered: