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
http://localhost:5000/notexist; session reinitialised after every failure
pass
pass
pass
http://localhost:5000/notexist; session not reinitialised
pass
pass
pass
http://localhost:5001/notexist; session reinitialised after every failure
pass
pass
pass
http://localhost:5001/notexist; session not reinitialised
pass
pass
(stuck)
Stack trace after pressing Ctrl+C shows that the event loop is stuck waiting on select():
Traceback (most recent call last):
File "/Users/crusaderky/Library/Preferences/PyCharmCE2019.1/scratches/aiohttp_ws_stuck.py", line 57, in <module>
asyncio.run(main())
File "/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/anaconda3/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
self.run_forever()
File "/anaconda3/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/anaconda3/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/anaconda3/lib/python3.7/selectors.py", line 558, in select
kev_list = self._selector.control(None, max_ev, timeout)
KeyboardInterrupt
Note: the fact that server and client are served by the same event loop is inconsequential. This issue remains when client and server are running in two separate Python interpreters.
Long story short
In a specific combination of aiohttp server and client, it is possible to get the client stuck after a ws_connect() call returns 404 from the server.
Steps to reproduce
In this very specific condition:
AND
AND
ClientSession.ws_connect()
failed with a 404 error (exception caught)AND
then a subsequent call to
ClientSession.get()
will get stuck.The following things make the error disappear:
Proof of concept:
Output:
Stack trace after pressing Ctrl+C shows that the event loop is stuck waiting on select():
Note: the fact that server and client are served by the same event loop is inconsequential. This issue remains when client and server are running in two separate Python interpreters.
Your environment
MacOS Mojave
anaconda
python 3.7.3-h359304d_0
aiohttp 3.5.4-py37h1de35cc_0
The text was updated successfully, but these errors were encountered: