-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
_sock_connect_cb can be called twice resulting in InvalidStateError #633
Comments
Fixed by upstream http://bugs.python.org/issue25593 |
@asvetlov we just got this in production with aiohttp 3.3.1 + python 3.6.6 :( Unfortunately not sure how to reproduce yet.
|
Could you describe how the problem is related to aiohttp? |
unable to place exact blame, just an FYI since this is happening on our aiohttp server but we have no more details yet as it only happens sporadically. |
Sorry for my attitude, it is not constructive. |
will do as soon as we have a reproduce-able case. info here in case anyone else runs into it so we can pool resources. |
2019-01-25 17:30:50 Desktop-493 asyncio[3728] ERROR Exception in callback BaseSelectorEventLoop._sock_connect_cb(, <socket.socke....236', 12138)>, ('10.40.40.236', 12138)) aiohttp: 3.5.4 tasks = [] and put it in multiprocessing.Process |
|
as long as each sub-process has a new event loop it should work. I've worked with python maintainers before to ensure this workflow. |
looks like a PR for official support is stalled: https://bugs.python.org/issue22087, this discussion: python/asyncio#452 let to this fix: python/asyncio#497 |
I'm posting this bug here as recommendation for Guido on the bug I logged there: http://bugs.python.org/issue25593. It seems like there's a logic error in terms of _sock_connect_cb whereby it can get called twice under certain circumstances. If I apply the simple fix to check if the future is already done I run into occasional connection errors.
Here is my simple testcase:
The text was updated successfully, but these errors were encountered: