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

RuntimeError: got Future <Future pending> attached to a different loop #67

Open
Digletto opened this issue Jun 23, 2022 · 2 comments
Open

Comments

@Digletto
Copy link

When running remote server using the latest release (default requirements installed only), I run into this error when sending inputs. Here's the full error message:

Task exception was never retrieved
future: <Task finished coro=<AsyncServer._handle_event_internal() done, defined at C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py:506> exception=RuntimeError('Task <Task pending coro=<AsyncServer._handle_event_internal() running at C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py:508>> got Future attached to a different loop')>
Traceback (most recent call last):
File "C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py", line 508, in _handle_event_internal
r = await server._trigger_event(data[0], namespace, sid, *data[1:])
File "C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py", line 542, in _trigger_event
ret = await handler(*args)
File "server.py", line 91, in send_input
return await future
RuntimeError: Task <Task pending coro=<AsyncServer._handle_event_internal() running at C:\Python\Python37\lib\site-packages\socketio\asyncio_server.py:508>> got Future attached to a different loop

I think the line should be 88, I've just added some logging for debugging. I can avoid the error if I update the stored loop after connecting with g.sio_loop = asyncio.get_running_loop(). But then the input result events never show up in unreal.

@Digletto
Copy link
Author

Eventually got it to work by running g.sio_loop = asyncio.get_running_loop() whenever sendInput is called. Not sure if this slows everything down though.

@getnamo
Copy link
Owner

getnamo commented Nov 17, 2022

fixed in getnamo/ml-remote-server@5941fe2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants