Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915896 - sys-apps/portage: ForkProcess should support fd_pipes via multiprocessing.Pipe and send_handle/recv_handle
Summary: sys-apps/portage: ForkProcess should support fd_pipes via multiprocessing.Pip...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 916031
Blocks: 914876
  Show dependency tree
 
Reported: 2023-10-17 16:21 UTC by Zac Medico
Modified: 2024-02-05 21:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2023-10-17 16:21:21 UTC
For platforms where multiprocessing.reduction.HAVE_SEND_HANDLE is true, ForkProcess should be able to support fd_pipes via multiprocessing.Pipe and send_handle/recv_handle.
Comment 1 Zac Medico gentoo-dev 2023-10-17 18:19:02 UTC
The unix-only sendfds/recvfds functions might be better than send_handle/recv_handle. Either way, we'll need a helper class to manage sending the fd_pipes file descriptors to the child process asynchronously.
Comment 2 Larry the Git Cow gentoo-dev 2023-10-22 04:34:25 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=6abc969109754ab086db2bac5be1029de1a015c3

commit 6abc969109754ab086db2bac5be1029de1a015c3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-10-20 04:11:48 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-10-22 04:17:48 +0000

    ForkProcess: Implement fd_pipes via send_handle
    
    This new fd_pipes implementation is only enabled
    when the multiprocessing start method is not fork,
    ensuring backward compatibility with existing
    ForkProcess callers that rely on the fork start
    method.
    
    Note that the new fd_pipes implementation uses a
    thread via run_in_executor, and threads are not
    recommended for mixing with the fork start method
    due to cpython issue 84559.
    
    Bug: https://bugs.gentoo.org/915896
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/tests/process/test_ForkProcess.py |   7 ++
 lib/portage/util/_async/ForkProcess.py        | 142 +++++++++++++++++++++-----
 2 files changed, 124 insertions(+), 25 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2023-10-25 05:49:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b9128b401def05cac46f9e6d66048e5a0d888b8

commit 2b9128b401def05cac46f9e6d66048e5a0d888b8
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-25 05:48:31 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-25 05:48:40 +0000

    sys-apps/portage: add 3.0.54
    
    Closes: https://bugs.gentoo.org/905869
    Closes: https://bugs.gentoo.org/915551
    Closes: https://bugs.gentoo.org/915896
    Closes: https://bugs.gentoo.org/916106
    Closes: https://bugs.gentoo.org/916108
    Closes: https://bugs.gentoo.org/916112
    Closes: https://bugs.gentoo.org/916116
    Closes: https://bugs.gentoo.org/916139
    Closes: https://bugs.gentoo.org/916141
    Closes: https://bugs.gentoo.org/916142
    Closes: https://bugs.gentoo.org/916149
    Closes: https://bugs.gentoo.org/916182
    Closes: https://bugs.gentoo.org/916231
    Closes: https://bugs.gentoo.org/916235
    Closes: https://bugs.gentoo.org/916240
    Closes: https://bugs.gentoo.org/916242
    Closes: https://bugs.gentoo.org/916245
    Closes: https://bugs.gentoo.org/916248
    Closes: https://bugs.gentoo.org/899898
    Closes: https://bugs.gentoo.org/906129
    Closes: https://bugs.gentoo.org/906156
    Closes: https://bugs.gentoo.org/916031
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.54.ebuild | 238 +++++++++++++++++++++++++++++++++
 2 files changed, 239 insertions(+)