Skip to content
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

Asyncio "no PONG received in 3 seconds" after 30 seconds #59

Open
oplatek opened this issue Feb 5, 2017 · 3 comments
Open

Asyncio "no PONG received in 3 seconds" after 30 seconds #59

oplatek opened this issue Feb 5, 2017 · 3 comments

Comments

@oplatek
Copy link

oplatek commented Feb 5, 2017

Hi,
I am wondering if the asyncio implementation sends the PINGs in the background because I receive no PONG received in 3 seconds every single time after 30 seconds.

My understanding is that the ping is sent every websocket.timeout in seconds and the websocket waits 3 seconds to receive PONG message, am I right?

@stepheny
Copy link
Contributor

stepheny commented Mar 1, 2017

Sorry for a late reply.
In brief, not quite. websocket.timeout is not supposed to be the exact PING/PONG period yet quite related.
Indeed PING/PONG messages are managed by uwsgi's websocket implementation, but uwsgi exposes no related api. Theoretically that timeout should not be necessary. If we use either bare uwsgi or the blocking uwsgi.websocket_recv, PING/PONG messages would be handled by uwsgi automatically. But once behind a reverse proxy or a load balancer, which would be a trivial setup, without calling uwsgi.websocket_recv_nb or uwsgi.websocket_recv uwsgi might not handle PING/PONG messages properly, resulting a timeout disconnect. So, websocket.timeout is just used to periodically trigger uwsgi to handle PING/PONG messages, and uwsgi will decide whether it should be sent which we cannot control.

@mohamad-hasan-sohan-ajini

Hi

I use this repo to stream client microphone samples to server. Unfortunately, every time I get aforementioned error, which consequences client websocket to close and so the program stop working...

If there is no way to control such crucial parameter of uwsgi, I think you choosed inappropriate library as base! Please give my start back!

@ajs124
Copy link

ajs124 commented Nov 17, 2017

This seems to be a bug in uwsgi, see this pull request: unbit/uwsgi#1261.

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

No branches or pull requests

4 participants