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

Bug 666940

Summary: sys-apps/portage: add portdbapi.async_xmatch method (asynchronous version of xmatch)
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: drobbins
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 648790    
Bug Blocks: 666956    

Description Zac Medico gentoo-dev 2018-09-24 03:03:26 UTC
It's not possible to call portdbapi.xmatch in an asynchronous context, since the internal synchronous aux_get call would trigger event loop recursion. Therefore, an async_xmatch method is desirable.
Comment 2 Larry the Git Cow gentoo-dev 2018-09-24 07:30:13 UTC
The bug has been referenced in the following commit(s):

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

commit ebd2c386f5ae2aced4c3ea05dacffdb99bd0bf5b
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-09-24 03:04:13 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-09-24 06:45:32 +0000

    portdbapi: add async_xmatch method (bug 666940)
    
    Add an async_xmatch method, and use it to implement the synchronous
    xmatch method. Deprecate unused xmatch method parameters. Use the
    compat_coroutine decorator for backward compatibility with python2.7
    (via PEP 342 enhanced generators).
    
    Bug: https://bugs.gentoo.org/666940
    Suggested-by: Daniel Robbins <drobbins@funtoo.org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/dbapi/porttree.py | 60 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 49 insertions(+), 11 deletions(-)