Summary: | sys-apps/portage: [TRACKER] add asyncio.get_running_loop() and asyncio.run(coro) compat shims and migrate to them | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Zac Medico <zmedico> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | zmedico |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://github.com/gentoo/portage/pull/1275 https://bugs.gentoo.org/show_bug.cgi?id=916566 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 763339 | ||
Bug Blocks: | 758719 |
Description
Zac Medico
2020-12-24 23:42:11 UTC
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=631bedffe29124d693de3b539fc908d9feec1420 commit 631bedffe29124d693de3b539fc908d9feec1420 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-09-19 22:05:38 -0700 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-09-19 22:08:47 -0700 _safe_loop: fix python3.10 DeprecationWarning DeprecationWarning: There is no current event loop Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/util/futures/_asyncio/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=fbaaa4a733aaadc2744b656527756ac4e2b7ab58 commit fbaaa4a733aaadc2744b656527756ac4e2b7ab58 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2024-02-22 06:47:33 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2024-02-22 07:28:38 +0000 socks5: Use real asyncio.run Use real asyncio.run to demonstrate that it is compatible with portage internals. Since the socks5 ProxyManager uses the process.spawn function, the internal _running_loop function needs to return the correct loop for use in the wait method of MultiprocessingProcess, or else it will lead to Future "attached to a different loop" errors. Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/tests/util/test_socks5.py | 45 +++++++++++++++++++---------------- lib/portage/util/socks5.py | 30 ++++++++++++++++------- 2 files changed, 46 insertions(+), 29 deletions(-) https://gitweb.gentoo.org/proj/portage.git/commit/?id=d718cea94a180042b2285698b2c19113c5d25987 commit d718cea94a180042b2285698b2c19113c5d25987 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2024-02-22 06:41:49 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2024-02-22 07:28:38 +0000 _get_running_loop: Support real asyncio.run When called via the real asyncio.run implementation, wrap the running asyncio loop. Otherwise, it's not possible to call portage libraries via the real asyncio.run without triggering Future "attached to a different loop" errors. Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/util/futures/_asyncio/__init__.py | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) |