Replies: 1 comment 9 replies
-
Are you using a greenlet framework (eventlet or gevent) in this application? If yes, have you monkey patched the standard library? And is the |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to track down a tricky issue in my webapp dealing with back-and-forth communication between the client and socketio server.
Environment Details
6.1.0-rpi7-rpi-v8
I am running this using the built-in Flask/SocketIO server and web connections are reverse proxied from an Nginx frontend. Nginx is handling the connection upgrade for
/socket.io
:Context
I have not experienced this issue with any other websocket communications elsewhere in my app. Also, this is a single-user app I'm developing that is self-hosted on a Raspberry Pi. This particular websocket exchange is intended to provide information on the execution of a backup routine in my app through three stages - requested, in progress, and done. The impact of this issue is that the web UI jumps from requested to done, due to the delay in the in progress message coming through the websocket.
Debugging
I've enabled logging in the socketio extension and it appears to be sending the message, but it doesn't show up on the client for another 15 seconds (until another message is emitted over the socket, then both show up together).
See the annotated screenshot below for some details from my browser and the application logs. Specifically, it's the 'backup started' message that is delayed.
In the screenshot, you'll also see another log message with no timestamp (the
Sent event ... to ... in namespace ... containing args
. This is just a quick print statement in the SocketIO class definition's emit method, right after the call toself.server.emit()
The entire websocket for my
run-backup-now
event is here. You'll see that I've tried running the potentially time-consuming backup routine as a subprocess (commented out in my current attempt) as well, but it makes no difference.So, I'm stumped, and I'm hoping you can help out.
PS - moving from "legacy" GETs and POSTs to websockets for communication between frontend and backend has been such a wonderful change, I can't even put it into words. Thank you for this library!
Beta Was this translation helpful? Give feedback.
All reactions