Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 614104 - AbstractPollTask._unregister_if_appropriate triggers event loop recursion
Summary: AbstractPollTask._unregister_if_appropriate triggers event loop recursion
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 591760 651804
  Show dependency tree
Reported: 2017-03-28 03:48 UTC by Zac Medico
Modified: 2018-07-02 18:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-03-28 03:48:35 UTC
The AbstractPollTask._unregister_if_appropriate method calls self.wait() before the process exit status has become available, which for subclasses of SubProcess will ultimately triggering recursion in the SubProcess._waitpid_loop method. This is only a problem for EbuildMetadataPhase, since it's the only subclass of SubProcess that calls _unregister_if_appropriate.
Comment 1 Larry the Git Cow gentoo-dev 2018-04-22 18:26:00 UTC
The bug has been referenced in the following commit(s):

commit c5ab0696cec1f0f020d2d8ad416f9b1444a467de
Author:     Zac Medico <>
AuthorDate: 2018-04-22 18:16:55 +0000
Commit:     Zac Medico <>
CommitDate: 2018-04-22 18:16:55 +0000

    SubProcess: fix _unregister_if_appropriate event loop recursion (bug 614104)
    Override the AbstractPollTask._unregister_if_appropriate method to avoid
    event loop recursion when the pid exit status is not yet available, by
    calling self._async_waitpid() instead of self.wait(). Also make
    _async_waitpid fallback to _async_wait if the pid exit status happens to
    be available already.

 pym/_emerge/ | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)}
Comment 2 Zac Medico gentoo-dev 2018-07-02 18:40:10 UTC
Fixed in portage-2.3.40-r1.