Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916142 - sys-apps/portage: Event loop closure must be protected with __name__ == "__main__" for multiprocessing spawn
Summary: sys-apps/portage: Event loop closure must be protected with __name__ == "__ma...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 916031
Blocks: 914876
  Show dependency tree
 
Reported: 2023-10-22 22:42 UTC by Zac Medico
Modified: 2023-10-25 05:49 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-22 22:42:24 UTC
As noted in bug 916106 comment #3, code like this in bin/emerge needs to be protected by a __name__ == "__main__" conditional in order to prevent it from closing loops in child processes when using the multiprocessing spawn start method:

> finally:
>     global_event_loop().close()
Comment 1 Larry the Git Cow gentoo-dev 2023-10-24 02:10:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=986b59bd7443b23146217f581e7b3b82a5d4912f

commit 986b59bd7443b23146217f581e7b3b82a5d4912f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-10-24 01:43:03 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-10-24 02:09:53 +0000

    bin/emaint: Use __main__ for spawn compat
    
    If the event loop is closed outside of __main__
    then it closes the event loop in child processes
    for the multiprocessing spawn start method.
    
    Bug: https://bugs.gentoo.org/916142
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/emaint | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2023-10-24 02:21:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=4ec75ab8717787d5f24f35685cfc138f5a77901f

commit 4ec75ab8717787d5f24f35685cfc138f5a77901f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-10-24 01:05:57 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-10-24 02:14:29 +0000

    bin/ebuild: Use __main__ for spawn compat
    
    If the event loop is closed outside of __main__
    then it closes the event loop in child processes
    for the multiprocessing spawn start method.
    
    Bug: https://bugs.gentoo.org/916142
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/ebuild | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2023-10-24 02:27:41 UTC
The bug has been referenced in the following commit(s):

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

commit b089dd5bed1b7d2a5d4edd447d9df38ae12093b6
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-10-24 01:26:26 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-10-24 02:24:34 +0000

    bin/emerge: Use __main__ for spawn compat
    
    If the event loop is closed outside of __main__
    then it closes the event loop in child processes
    for the multiprocessing spawn start method.
    
    Bug: https://bugs.gentoo.org/916142
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/emerge | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2023-10-25 05:49:05 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(+)