Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653848 - EbuildMerge._merge_exit event loop recursion
Summary: EbuildMerge._merge_exit event loop recursion
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 591760 651804
  Show dependency tree
 
Reported: 2018-04-23 01:26 UTC by Zac Medico
Modified: 2018-07-02 18:52 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2018-04-23 01:26:50 UTC
In EbuildMerge._merge_exit, the call to self.world_atom(pkg) triggers event loop recursion:

> Traceback (most recent call last):
>   File "bin/emerge", line 51, in <module>
>     retval = emerge_main()
>   File "pym/_emerge/main.py", line 1282, in emerge_main
>     return run_action(emerge_config)
>   File "pym/_emerge/actions.py", line 3316, in run_action
>     retval = action_build(emerge_config, spinner=spinner)
>   File "pym/_emerge/actions.py", line 541, in action_build
>     retval = mergetask.merge()
>   File "pym/_emerge/Scheduler.py", line 1004, in merge
>     rval = self._merge()
>   File "pym/_emerge/Scheduler.py", line 1409, in _merge
>     self._main_loop()
>   File "pym/_emerge/Scheduler.py", line 1387, in _main_loop
>     self._event_loop.iteration()
>   File "pym/portage/util/_eventloop/EventLoop.py", line 281, in iteration
>     return self._iteration(*args)
>   File "pym/portage/util/_eventloop/EventLoop.py", line 302, in _iteration
>     if self._run_timeouts():
>   File "pym/portage/util/_eventloop/EventLoop.py", line 597, in _run_timeouts
>     if self._run_idle_callbacks():
>   File "pym/portage/util/_eventloop/EventLoop.py", line 556, in _run_idle_callbacks
>     if x._callback(*x._args):
>   File "pym/_emerge/AsynchronousTask.py", line 74, in _async_wait_cb
>     self.wait()
>   File "pym/_emerge/AsynchronousTask.py", line 57, in wait
>     self._wait_hook()
>   File "pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
>     self._exit_listener_stack.pop()(self)
>   File "pym/_emerge/EbuildMerge.py", line 44, in _merge_exit
>     self.world_atom(pkg)
>   File "pym/_emerge/Scheduler.py", line 1946, in _world_atom
>     atom = create_world_atom(pkg, args_set, root_config)
>   File "pym/_emerge/create_world_atom.py", line 43, in create_world_atom
>     for cpv in portdb.match(Atom(cp)):
>   File "pym/portage/dbapi/porttree.py", line 1170, in match
>     return self.xmatch("match-visible", mydep)
>   File "pym/portage/dbapi/porttree.py", line 1108, in xmatch
>     self.aux_get(cpv, aux_keys, myrepo=repo)))
>   File "pym/portage/dbapi/porttree.py", line 587, in aux_get
>     myrepo=myrepo, loop=loop))
>   File "pym/portage/util/_eventloop/EventLoop.py", line 827, in run_until_complete
>     self.iteration()
Comment 1 Larry the Git Cow gentoo-dev 2018-04-23 02:41:22 UTC
The bug has been referenced in the following commit(s):

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

commit bb2484afc217058267b5ba5d2d792bc1c46203b7
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-04-23 02:27:53 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-04-23 02:38:53 +0000

    Scheduler: fix create_world_atom event loop recursion (bug 653848)
    
    Generate world atoms while the event loop is not running, since
    otherwise portdbapi match calls in the create_world_atom function
    could trigger event loop recursion.
    
    Bug: https://bugs.gentoo.org/653848

 pym/_emerge/Scheduler.py         | 19 ++++++++++++++-----
 pym/_emerge/create_world_atom.py |  6 ++++--
 2 files changed, 18 insertions(+), 7 deletions(-)}
Comment 2 Zac Medico gentoo-dev 2018-07-02 18:52:03 UTC
Fixed in portage-2.3.40-r1.