-
Notifications
You must be signed in to change notification settings - Fork 30
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
awaiting a future attached to a different loop #43
Comments
Actually having just typed it, actually I think it does make sense. The Queue is created in a different loop than where it was awaited. I'm not familiar with the code yet but I'll dig around. |
This is surprising - as I understand it, you are using the tutorial code without modification? I will need to check if anything changed in Python 3.9 that might have caused the issue. |
yes, I copied pasted the code there verbatim. I'm running Raspbian 11, the python I'm using is the stock distro version Python 3.9.2 (default, Mar 12 2021, 04:06:34) as I say, nothing fancy was needed to trigger it, just ran the script as it is in the tutorial, and opened the URL (from my laptop, not directly on the Pi) |
I have confirmed the issue on pi 4 with latest raspbian. I don't know if I will have time to look into it this weekend, so it might be a week or two before I can fix it. |
It looks like loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop) and then setting the loop manually: conn = RTCConnection(loop=loop)
web.run_app(app,loop=loop) I will try to fix this more deeply. |
Hey @dkumor thanks for your effort to keep this project alive! I'm returning back to webrtc ;-) |
Quick update: I tested the code on python3.8 and it shows the same behaviour. Perhaps a downgrade or aiohttp may help? But indeed, your workaround seems to do the job! :-) |
Running on a recent raspberry pi, I tried to run the script under the tutorial heading
Talking to Python from the Browser
Once I open the link in the browser the script begins rapidly spewing errors of the form:
RuntimeError: Task <Task pending name='Task-11627' coro=<Queue.get() running at /usr/lib/python3.9/asyncio/queues.py:166> cb=[<TaskWakeupMethWrapper object at 0xa8a25a18>()]> got Future attached to a different loop
Got unrecognized error from task. ignoring:
Traceback (most recent call last):
File "/home/pi/src/rtcbot/rtcbot/base/base.py", line 365, in _get
await self._getTask
File "/usr/lib/python3.9/asyncio/queues.py", line 166, in get
await getter
As the src path suggests, I've pulled latest git in case this was somehow recently fixed.
Looking at the code in base.py around 365, self._getTask created just above it, should yield the same loop where await is called on 365 so I'm a bit confused about the error. But that's the error .... not sure what to make of it.
The text was updated successfully, but these errors were encountered: