Heroku Problems with Gevent (Request Timeout + Polling Hanging) #1289
Replies: 2 comments
-
Is anything not clear on this paragraph from the issue template that you even left in your bug report?
Please don't write issues on this package unless you can discuss a specific problem that you have found that you are 100% sure is a bug. That is the wrong way to call my attention to your problem. |
Beta Was this translation helpful? Give feedback.
-
You are using a mix of gevent and eventlet in the same application. Pick one and remove the other, you can't use both. |
Beta Was this translation helpful? Give feedback.
-
IMPORTANT: If you have a question, or you are not sure if you have found a bug in this package, then you are in the wrong place. Hit back in your web browser, and then open a GitHub Discussion instead. Likewise, if you are unable to provide the information requested below, open a discussion to troubleshoot your issue.
Describe the bug
I have a NextJS app on one domain (xxxxx.com) and the Flask server on another (api.xxxxx.com). Locally, it works fine but when I use eventlet/gevent, there seems to be some problems around request timeouts.
The exact stacktrace from the server is here.
In fact - you can go to the website itself goiterative.com/tool and see that it seems that websocket upgrade fails then client switches to long polling. However, for some reason - this seems to be very resource intensive or the request times outs for whatever reason.
From the client side: 886-e67588dd3a7e1252.js:3 WebSocket connection to 'wss://api.goiterative.com/socket.io/?EIO=4&transport=websocket&sid=CGtn1SbayJ79n3LAAAAA' failed: WebSocket is closed before the connection is established. - I routinely see something like this and the actual GET/POST requests to the /socket.io endpoints are constantly hanging and the requests never finish.
This only happens on Heroku.
My Procfile: web: gunicorn -k gevent -w 1 "app:create_app()"
Flask create_app() code itself.
My client side JS code that interacts with Socket:
let socket: Socket<DefaultEventsMap, DefaultEventsMap> = io(SOCKET_IO_URL);;
Beta Was this translation helpful? Give feedback.
All reactions