-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Reconnect on HTTP 503 #485
Comments
There is nothing specific on the HTTP response codes. Any response status outside of the 200-399 range should trigger a disconnect. Do you have some example code I can use to reproduce this problem? |
Thanks for the fast response! I'm able to reproduce the problem with the following example client and server: import socketio
sio = socketio.Client(logger=True, engineio_logger=True)
sio.connect("http://localhost:8000") import socketio
import eventlet
sio = socketio.Server(logger=True, engineio_logger=True, ping_interval=5, allow_upgrades=False)
app = socketio.WSGIApp(sio)
count = 0
old_handle_request = sio.handle_request
def new_handle_request(environ, start_response):
print("received request")
global count
count += 1
if count >= 5:
raise Exception
return old_handle_request(environ, start_response)
sio.handle_request = new_handle_request
eventlet.wsgi.server(eventlet.listen(("", 8000)), app) And here are the logs:
In this example, the server responds with 500 after a while. The client exits and doesn't try to reconnect. |
Any progress on this? |
No, I haven't had time to look into this issue yet. I consider it low priority because if the server responds with a 500 it indicates a bug in the server that should be fixed. Also I haven't tested this, but I believe there is a simple workaround that can be used in the meantime:
I will eventually get to it, but I have a couple other issues that I have prioritized above this one that I need to solve first. |
This issue should be addressed by miguelgrinberg/python-engineio#254, to be released with python-engineio 4.9.0. |
Hello,
First of all, thank you for developing this amazing library!
I have a client that needs to be connected continuously. However, I encountred a server error and it responded with HTTP 503 for a ping packet. Here are the logs:
As you can see the client simply exits without trying to reconnect. Is there a way to let it reconnect?
I'm using python-socketio 4.5.1 and python-engineio 3.12.1.
The text was updated successfully, but these errors were encountered: