Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 739540

Summary: sys-apps/portage: use cached portage.getpid() function instead of os.getpid()
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 835380, 739718    

Description Zac Medico gentoo-dev 2020-08-29 19:16:07 UTC
The cached portage.getpid() function avoids unnecessary syscalls:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=6b08846736ebf8a224f8aad2a5b17baf66fec1e0
Comment 2 Larry the Git Cow gentoo-dev 2020-08-31 06:27:21 UTC
The bug has been referenced in the following commit(s):

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

commit cf07a23a0ff77049476e0f4b94afbb6a844806fa
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-08-29 20:13:44 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-08-31 06:25:05 +0000

    Use cached portage.getpid() function (bug 739540)
    
    Use the cached portage.getpid() function to avoid unnecessary syscalls,
    and update the cache after each call to os.fork() where the fork may
    invoke portage APIs.
    
    Bug: https://bugs.gentoo.org/739540
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/quickpkg                                             |  2 +-
 lib/_emerge/EbuildBinpkg.py                              |  4 +++-
 lib/_emerge/actions.py                                   |  2 +-
 lib/portage/_emirrordist/FetchTask.py                    |  4 ++--
 lib/portage/cache/metadata.py                            |  4 +++-
 lib/portage/elog/mod_mail_summary.py                     |  5 ++---
 lib/portage/elog/mod_save_summary.py                     |  2 +-
 lib/portage/locks.py                                     |  2 +-
 lib/portage/package/ebuild/doebuild.py                   |  2 +-
 lib/portage/process.py                                   | 16 +++++++++++-----
 lib/portage/tests/locks/test_lock_nonblock.py            |  1 +
 .../tests/util/futures/asyncio/test_wakeup_fd_sigchld.py |  2 +-
 lib/portage/util/__init__.py                             |  4 ++--
 lib/portage/util/_eventloop/EventLoop.py                 |  6 +++---
 lib/portage/util/_eventloop/asyncio_event_loop.py        |  4 ++--
 lib/portage/util/_eventloop/global_event_loop.py         |  7 +++----
 lib/portage/util/locale.py                               |  1 +
 lib/portage/util/movefile.py                             |  2 +-
 lib/portage/util/socks5.py                               |  2 +-
 lib/portage/xpak.py                                      |  2 +-
 20 files changed, 42 insertions(+), 32 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2020-08-31 07:08:14 UTC
The bug has been referenced in the following commit(s):

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

commit abdafd44b842135d6a06cf243720f878277ccbe2
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-08-31 06:54:49 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-08-31 07:08:07 +0000

    sys-apps/portage: Bump to version 3.0.5
    
     #439688 depgraph: Allow elimination of highest version after
             slot conflict, which prevents unecessary rebuilds for
             dev-lang/go after backtracking for a missed update
     #739540 Use cached portage.getpid() function to avoid syscalls
    
    Bug: https://bugs.gentoo.org/739718
    Bug: https://bugs.gentoo.org/439688
    Bug: https://bugs.gentoo.org/739540
    Package-Manager: Portage-3.0.5, Repoman-3.0.1
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest             |   1 +
 sys-apps/portage/portage-3.0.5.ebuild | 264 ++++++++++++++++++++++++++++++++++
 2 files changed, 265 insertions(+)