The BinpkgFetcher.lock method calls async_lock.wait(), which triggers event loop recursion until the lock has been acquired. The lock method only appears to be called from the start method (no external callers).
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/f1679177c9d087088730252dd42023e6 https://github.com/gentoo/portage/pull/310
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=adf2e6dd57b5bcaa4a668e3085024ebc3224a2ca commit adf2e6dd57b5bcaa4a668e3085024ebc3224a2ca Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2018-04-21 19:18:08 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2018-04-22 00:50:57 +0000 BinpkgFetcher: use async lock (bug 614110) In order to avoid event loop recursion, convert the _BinpkgFetcherProcess.lock() method to an async_lock method for use by BinpkgFetcher. Bug: https://bugs.gentoo.org/614110 Reviewed-by: Brian Dolbec <dolsen@gentoo.org> pym/_emerge/BinpkgFetcher.py | 53 +++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-)}
Fixed in portage-2.3.40-r1.