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

Redundant call to call_soon_threasafe when using PidfdChildWatcher #98057

Closed
graingert opened this issue Oct 7, 2022 · 4 comments
Closed

Redundant call to call_soon_threasafe when using PidfdChildWatcher #98057

graingert opened this issue Oct 7, 2022 · 4 comments
Labels
3.12 bugs and security fixes topic-asyncio

Comments

@graingert
Copy link
Contributor

graingert commented Oct 7, 2022

It would be better to move the responsibility to the child watchers for calling callbacks on the event loop thread. Currently the callback needs to defensively call call_soon_threadsafe which is redundant on the Pidfdchildwatcher

Eg

def _child_watcher_callback(self, pid, returncode, transp):
# Skip one iteration for callbacks to be executed
self.call_soon_threadsafe(self.call_soon, transp._process_exited, returncode)

Originally posted by @graingert in #94597 (comment)

@graingert graingert added topic-asyncio 3.12 bugs and security fixes labels Oct 7, 2022
@graingert
Copy link
Contributor Author

graingert commented Oct 7, 2022

This will probably need to wait for the deprecation of the child watcher system in #94597

@ezio-melotti ezio-melotti moved this to Todo in asyncio Oct 7, 2022
@gvanrossum gvanrossum changed the title redundant call to call_soon_threasafe when using Pidfdchildwatcher Redundant call to call_soon_threasafe when using PidfdChildWatcher Oct 8, 2022
@gvanrossum
Copy link
Member

Yeah, I notied this too when @1st1 and I were reviewing the watcher code this morning. Not sure we need to keep an issue open to remind us of this though.

@kumaraditya303
Copy link
Contributor

I doubt anything can be done for this until the entire child watcher system is removed and is harmless.

@kumaraditya303
Copy link
Contributor

Will take care of it in 3.14 when removing child watchers, no need for an issue for it, I am already working on it.

@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio Apr 18, 2023
@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes topic-asyncio
Projects
Status: Done
Development

No branches or pull requests

3 participants