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

Remove asyncio deprecated objects and methods #119627

Closed
SweetyAngel opened this issue May 27, 2024 · 7 comments
Closed

Remove asyncio deprecated objects and methods #119627

SweetyAngel opened this issue May 27, 2024 · 7 comments
Labels
topic-asyncio type-feature A feature request or enhancement

Comments

@SweetyAngel
Copy link
Contributor

SweetyAngel commented May 27, 2024

Feature or enhancement

Proposal:

There were deprecation warnings on asyncio ChildWatchers and methods, they are connected to. Now they are removed.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented May 28, 2024

This is not so straightforward, the subprocesses needs to be reimplemented without watchers before removing it. That has to be done carefully, the code is fragile here with lots of edge cases to deal with.

@SweetyAngel
Copy link
Contributor Author

the subprocesses needs to be reimplemented without watchers before removing it

I want to get a small advice about will it be enough to keep only one, standart ChildWatcher?

@gvanrossum
Copy link
Member

gvanrossum commented May 31, 2024

@SweetyAngel:
FWIW Previous discussions are at gh-94597 and gh-82772. IIRC the intention was to remove all APIs for getting/setting child watchers, but to leave one or more implementations as an internal detail.

I want to get a small advice about will it be enough to keep only one, standart ChildWatcher?

I think that implementation could either be ThreadedChildWatcher or it could be a choice between ThreadedChildWatcher and PidfdChildWatcher depending on the platform (the latter on Linux, the former on all other UNIX systems). The current code uses that:

    def _init_watcher(self):
        with events._lock:
            if self._watcher is None:  # pragma: no branch
                if can_use_pidfd():
                    self._watcher = PidfdChildWatcher()
                else:
                    self._watcher = ThreadedChildWatcher()

Perhaps we can keep this approach for now, and just remove the deprecated watcher classes? (BaseChildWatcher and its subclasses, SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher.)

@kumaraditya303
Copy link
Contributor

@SweetyAngel Would you like to continue work on this as Guido suggested? If not I'll take over and do it.

@SweetyAngel
Copy link
Contributor Author

SweetyAngel commented Jun 8, 2024

I ve already done it but i need to move it on new branch. New PR will appear in a few days

SweetyAngel added a commit to SweetyAngel/cpython that referenced this issue Jun 10, 2024
@kumaraditya303
Copy link
Contributor

I forgot actually I already have code for this, in a old branch, I'll resolve it and get it done faster. it will also include rewrite on child watchers.

@kumaraditya303
Copy link
Contributor

I am creating a new issue for this with much smaller items to work with.

@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio type-feature A feature request or enhancement
Projects
Status: Done
Development

No branches or pull requests

4 participants