You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mysterious crash when aiohttp.request takes too much time to execute ( ~2-3 sec ).
In my case it happens almost everytime when i make request to twitch.tv.
Doesn't seem to be aiohttp-only issue as it only happens with quamash loop.
>test.py
Traceback (most recent call last):
File "C:\Py36\lib\site-packages\quamash\_windows.py", line 46, in _process_events
f.set_result(value)
File "C:\Py36\lib\asyncio\windows_events.py", line 83, in set_result
super().set_result(result)
asyncio.base_futures.InvalidStateError: invalid state
So I'm not really keen on committing to more "low-level" (yeah, it's probably not that low :P) stuff because I don't have a full understanding of what's going on, but I found something that seems to work for me without causing troubles.
I noticed for some reason that quamash was getting the same Future instance twice and trying to set it as done twice... which as the documentation notes, raises the InvalidStateError in question. To avoid this problem, I simply added a check to see if the future was already marked as complete where the error occurs.
ifnotf.done():
f.set_result(value)
Now I'm not trying to be dogmatic about this fix here, it just worked for me and I was trying something quick and easy. It might be a bigger problem that quamash is receiving and trying to mark the same Future as complete twice, or that ignoring the second send of the Future may end up being problematic. But hey, if you're looking for a quick fix in the meantime! Maybe someone more experienced can give better insight into the issue, though.
Mysterious crash when aiohttp.request takes too much time to execute ( ~2-3 sec ).
In my case it happens almost everytime when i make request to twitch.tv.
Doesn't seem to be aiohttp-only issue as it only happens with quamash loop.
Windows==10.0.15063
Python==3.6
PyQt5==5.9
aiohttp>=2.0.3
quamash==0.5.5
@asvetlov
The text was updated successfully, but these errors were encountered: