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.
Patch posted for review: https://github.com/gentoo/portage/pull/368 https://archives.gentoo.org/gentoo-portage-dev/message/b3bee9849dbee86a84894f7a2c2860b9
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(-)