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

How can I fix this AsyncioWebSocket "RuntimeError: Event loop is closed" issue? #64

Open
c00kiemonster opened this issue Nov 15, 2017 · 0 comments

Comments

@c00kiemonster
Copy link

c00kiemonster commented Nov 15, 2017

I setup a Flask instance using AsyncioWebSocket websockets and implemented the echo example. It works completely fine, I can send and receive websocket messages just fine without any error messages on neither browser nor server side.

But if I leave it for a like 5-10 minutes and then load the echo example again I get these error messages below all of a sudden.

How can I fix this issue?

{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474548634, "msg":"Traceback (most recent call last):"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474549313, "msg":"  File \"/var/www/testweb/venv/lib/python3.5/site-packages/flask/app.py\", line 1997, in __call__"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474551626, "msg":"    return self.wsgi_app(environ, start_response)"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474552147, "msg":"  File \"/var/www/testweb/venv/lib/python3.5/site-packages/flask_uwsgi_websocket/_asyncio.py\", line 122, in __call__"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474552939, "msg":"    client = self.client(environ, uwsgi.connection_fd(), self.websocket.timeout, greenlet.getcurrent())"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474553487, "msg":"  File \"/var/www/testweb/venv/lib/python3.5/site-packages/flask_uwsgi_websocket/_asyncio.py\", line 23, in __init__"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474554201, "msg":"    self._loop.add_reader(self.fd, self._recv_ready)"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474554706, "msg":"  File \"/usr/lib/python3.5/asyncio/selector_events.py\", line 231, in add_reader"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474555640, "msg":"    self._check_closed()"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474556135, "msg":"  File \"/usr/lib/python3.5/asyncio/base_events.py\", line 334, in _check_closed"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474557029, "msg":"    raise RuntimeError('Event loop is closed')"}
{"datetime":"11/15/2017 15:54:34", "timestamp":1510732474557545, "msg":"RuntimeError: Event loop is closed"}
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

1 participant