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

Ignored "BlockingIOError: [Errno 11] Resource temporarily unavailable" are still haunting us #84814

Closed
YaroslavHalchenko mannequin opened this issue May 15, 2020 · 10 comments
Labels

Comments

@YaroslavHalchenko
Copy link
Mannequin

YaroslavHalchenko mannequin commented May 15, 2020

BPO 40634
Nosy @asvetlov, @1st1

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-05-15.15:30:02.322>
labels = ['3.7', '3.8', 'expert-asyncio']
title = 'Ignored "BlockingIOError: [Errno 11] Resource temporarily unavailable" are still haunting us'
updated_at = <Date 2020-06-15.12:50:39.417>
user = 'https://bugs.python.org/YaroslavHalchenko'

bugs.python.org fields:

activity = <Date 2020-06-15.12:50:39.417>
actor = 'Yaroslav.Halchenko'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['asyncio']
creation = <Date 2020-05-15.15:30:02.322>
creator = 'Yaroslav.Halchenko'
dependencies = []
files = []
hgrepos = []
issue_num = 40634
keywords = []
message_count = 2.0
messages = ['368953', '371540']
nosy_count = 3.0
nosy_names = ['asvetlov', 'Yaroslav.Halchenko', 'yselivanov']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue40634'
versions = ['Python 3.5', 'Python 3.6', 'Python 3.7', 'Python 3.8']

@YaroslavHalchenko
Copy link
Mannequin Author

YaroslavHalchenko mannequin commented May 15, 2020

This is a reincarnation of previous issues such as

In our project we are slowly introducing use of asyncio and have a mix of execution with asyncio and regular subprocess.Popen. We do run lots of short lived processes serially, and I think it should be Ok, i.e. it should not cause underlying libraries to spit out some output to ignore unless we indeed just using them incorrectly somehow.

If we recreate the SelectorEventLoop for every separate execution via asyncio -- no ignored exception messages are displayed. But if we start to reuse the same loop -- they eventually emerge. If I enable asyncio debug and log it along with our own debug messages, the strange thing that they come around the points where we run using regular subprocess.Popen, not asyncio. See datalad/datalad#4527 (comment) for more information.

Unfortunately I do not have (yet) any short script to reproduce it, but I would appreciate possible hints on how to figure out what is actually causing them in our particular case. May be additional logging within asyncio could assist?

@YaroslavHalchenko YaroslavHalchenko mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life topic-asyncio labels May 15, 2020
@YaroslavHalchenko
Copy link
Mannequin Author

YaroslavHalchenko mannequin commented Jun 15, 2020

any feedback/ideas/fixes would still be highly appreciated. Thank you!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@kumaraditya303
Copy link
Contributor

I am not sure we can do anything about this as there is no reproducer. I can only suggest you to use asyncio.PidfdChildWatcher which can handle a lot of subprocesses on Linux. Also Andrew commented that this does not happen on 3.8+ #82285 (comment) so closing.

Create a new issue with reproducer if this is still an issue on supported Python versions.

@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
@gvanrossum
Copy link
Member

gvanrossum commented Oct 4, 2022

I believe the OP is @yarikoptic.

Question for OP: does this still occur on more recent Python versions? Could you try Kumar's suggestion and report back?

We are aware that child process exit handling in asyncio is imperfect. See e.g. #94597.

@gvanrossum gvanrossum reopened this Oct 4, 2022
@kumaraditya303
Copy link
Contributor

I believe the OP is @yarikoptic.

Oh, I tried the same GitHub username YaroslavHalchenko but there was no account hence I closed.

@kumaraditya303
Copy link
Contributor

FTR before closing I tried the script posted in #82285 and I was only able to reproduce this on 3.7 which is EOL and not on 3.8+.

@gvanrossum
Copy link
Member

Oh, I tried the same GitHub username YaroslavHalchenko but there was no account hence I closed.

I found it by using GitHub search, clicking on the 4 user results, and going through all of them. Only one had significant activity, and they had "datalad" in their user description, so I figured that was the OP. :-)

In other cases I've used bpo user list search, but I don't know if you have access to that. In this case there was no GH username.

FTR before closing I tried the script posted in #82285 and I was only able to reproduce this on 3.7 which is EOL and not on 3.8+.

The problem seems due to processes exiting faster than what the watcher can keep up, and since the OP acknowledged that some relieve was provided by 3.8, I imagine it's hard to repro.

@kumaraditya303
Copy link
Contributor

I found it by using GitHub search, clicking on the 4 user results, and going through all of them. Only one had significant activity, and they had "datalad" in their user description, so I figured that was the OP. :-)

Ok, hit and trial :)

The problem seems due to processes exiting faster than what the watcher can keep up, and since the OP acknowledged that some relieve was provided by 3.8, I imagine it's hard to repro.

Yes, hence I suggested to use asyncio.PidfdChildWatcher which can handle a lot of subprocesses since it does not uses wakeup fd mechanism.

@yarikoptic
Copy link

I believe the OP is @yarikoptic.

FWIW

  • confirming that YaroslavHalchenko on https://bugs.python.org/issue40634 is me.
  • original issue is no longer "pressing" for us since we moved back to non-asyncio implementation of subprocesses execution.

@gvanrossum
Copy link
Member

Thanks! Then I'll close this issue, given that we already know child watchers aren't optimal.

@gvanrossum gvanrossum closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants