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

Bug 711178

Summary: sys-apps/portage-2.3.90 with binary packages : RuntimeError: This event loop is already running
Product: Portage Development Reporter: Kobboi <gentoo>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: cyshei
Priority: Normal Keywords: InVCS, REGRESSION
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 711148    

Description Kobboi 2020-03-01 16:26:05 UTC
christophe@tanagra ~ $ sudo emerge -1Gav nano

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R    ] app-editors/nano-4.8::gentoo  USE="magic ncurses nls spell (split-usr) unicode -debug -justify -minimal -slang -static" 1,326 KiB

Total: 1 package (1 reinstall, 1 binary), Size of downloads: 1,326 KiB

Would you like to merge these packages? [Yes/No] y

>>> Emerging binary (1 of 1) app-editors/nano-4.8::gentoo
Exception in callback SequentialTaskQueue._task_exit(<_emerge.Binp...x7fa843095af8>)(<Future finis...dy running',)>)
handle: <Handle SequentialTaskQueue._task_exit(<_emerge.Binp...x7fa843095af8>)(<Future finis...dy running',)>)>
Traceback (most recent call last):
  File "/usr/lib64/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/usr/lib64/python3.6/site-packages/_emerge/SequentialTaskQueue.py", line 65, in _task_exit
    future.result()
  File "/usr/lib64/python3.6/site-packages/portage/util/futures/compat_coroutine.py", line 113, in _next
    future = self._generator.throw(previous.exception())
  File "/usr/lib64/python3.6/site-packages/_emerge/SequentialTaskQueue.py", line 54, in _task_coroutine
    yield task.async_start()
  File "/usr/lib64/python3.6/site-packages/portage/util/futures/compat_coroutine.py", line 113, in _next
    future = self._generator.throw(previous.exception())
  File "/usr/lib64/python3.6/site-packages/_emerge/AsynchronousTask.py", line 31, in async_start
    yield self._async_start()
  File "/usr/lib64/python3.6/site-packages/portage/util/futures/compat_coroutine.py", line 107, in _next
    future = next(self._generator)
  File "/usr/lib64/python3.6/site-packages/_emerge/AsynchronousTask.py", line 44, in _async_start
    self._start()
  File "/usr/lib64/python3.6/site-packages/_emerge/BinpkgFetcher.py", line 44, in _start
    AsyncTaskFuture(future=fetcher.async_lock()),
  File "/usr/lib64/python3.6/site-packages/_emerge/BinpkgFetcher.py", line 232, in async_lock
    self._lock_obj.start()
  File "/usr/lib64/python3.6/site-packages/_emerge/AsynchronousTask.py", line 52, in start
    self._start()
  File "/usr/lib64/python3.6/site-packages/_emerge/AsynchronousLock.py", line 47, in _start
    self.scheduler.run_until_complete(self._async_start())
  File "/usr/lib64/python3.6/site-packages/portage/util/_eventloop/asyncio_event_loop.py", line 140, in _run_until_complete
    return self._loop.run_until_complete(future)
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 475, in run_until_complete
    self.run_forever()
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 429, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
--Return--
> /usr/lib64/python3.6/site-packages/portage/util/_eventloop/asyncio_event_loop.py(81)_internal_caller_exception_handler()->None
-> pdb.set_trace()
(Pdb) 


Reproducible: Always
Comment 1 Kobboi 2020-03-01 16:27:22 UTC
Problem only with emerging binary packages (only tested from binhost)

Downgrading to portage-2.3.89: OK again
Upstepping to portage-2.3.90: broken again
Comment 2 Kobboi 2020-03-01 16:30:33 UTC
$ emerge --info
Portage 2.3.90 (python 3.6.10-final-0, kobboi/tanagra, gcc-9.2.0, glibc-2.30-r4, 5.4.23 x86_64)
=================================================================
System uname: Linux-5.4.23-x86_64-Intel-R-_Core-TM-_i7_CPU_930_@_2.80GHz-with-gentoo-2.7
KiB Mem:     8146700 total,   3255384 free
KiB Swap:          0 total,         0 free
Head commit of repository gentoo: cf9dd8c623ed91838150a5b860d12cb716ed2cc4

Head commit of repository brother-overlay: d0890f9919545144ced103c503b7b58187717bc2

Head commit of repository flatpak-overlay: dba2292fa92fbe7f51a437ff89d27cbab6105b67

sh bash 5.0_p16
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 3.7.7 [disabled]
app-shells/bash:          5.0_p16::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17-r1::gentoo, 3.6.10::gentoo, 3.7.6::gentoo, 3.8.2::gentoo
dev-util/ccache:          3.7.7-r1::gentoo
dev-util/cmake:           3.16.4::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r2::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            6.5.0-r1::gentoo, 9.2.0-r4::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r4::gentoo
Repositories:

gentoo
    location: /var/cache/kobboi/gentoo
    sync-type: git
    sync-uri: https://github.com/kobboi/gentoo.git
    priority: -1000

brother-overlay
    location: /usr/local/overlay/brother-overlay
    sync-type: git
    sync-uri: https://github.com/stefan-langenmaier/brother-overlay.git
    masters: gentoo

flatpak-overlay
    location: /var/lib/layman/flatpak-overlay
    sync-type: git
    sync-uri: https://github.com/fosero/flatpak-overlay.git
    masters: gentoo
    priority: 50

Installed sets: @kobboi-machine-tanagra
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=x86-64 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=x86-64 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/src/debug /usr/lib/debug"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BINHOST="ssh://christophe@10.8.0.6/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 avahi berkdb bluetooth bzip2 cairo cdda cdr cli colord crypt cups cxx dbus djvu dri dts dvd dvdr eds egl emboss encode evo exif ffmpeg flac fluidsynth fortran frei0r gdbm gif glade gles gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gtk3 gtkstyle iconv icu introspection ipv6 jpeg lcms ldap libass libnotify libsecret libtirpc mad midi mng modemmanager mono mp3 mp4 mpeg mtp multilib nautilus ncurses networkmanager nls nptl ogg opengl openmp opus pam pango pcre pdf png policykit ppds pulseaudio qt5 readline samba sdl seccomp smartcard smp spell split-usr ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis wayland wxwidgets x264 xattr xcb xml xv xvid zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse synaptics libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="vesa radeon nvidia intel amdgpu dummy fbdev nouveau radeonsi v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Larry the Git Cow gentoo-dev 2020-03-01 18:36:20 UTC
The bug has been referenced in the following commit(s):

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

commit 1681309f252a4e91d7256b895a9af26ef82a9b30
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-03-01 18:28:21 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-03-01 18:36:04 +0000

    _BinpkgFetcherProcess: fix async_lock event loop recursion (bug 711178)
    
    Make the async_lock method use the AsynchronousLock async_start
    method in order to avoid event loop recursion.
    
    Fixes: 5c40c3e7e ("SpawnProcess: use async_start method (bug 709746)")
    Bug: https://bugs.gentoo.org/711178
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/BinpkgFetcher.py | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)
Comment 4 Zac Medico gentoo-dev 2020-03-01 18:53:00 UTC
*** Bug 704274 has been marked as a duplicate of this bug. ***
Comment 5 Larry the Git Cow gentoo-dev 2020-03-02 05:22:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f1811d916f1ece1c356cab3da4e95d30fa61a04

commit 2f1811d916f1ece1c356cab3da4e95d30fa61a04
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-03-02 05:18:56 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-03-02 05:20:50 +0000

    sys-apps/portage: Bump to version 2.3.91
    
     #705910 remove pdb.set_trace() from exception handler
     #711174 FEATURES=compress-build-logs EOFError regression
     #711178 emerge --getbinpkg event loop recursion regression
    
    Bug: https://bugs.gentoo.org/711148
    Bug: https://bugs.gentoo.org/705910
    Closes: https://bugs.gentoo.org/711174
    Closes: https://bugs.gentoo.org/711178
    Package-Manager: Portage-2.3.91, Repoman-2.3.20
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest                                         | 2 +-
 sys-apps/portage/{portage-2.3.90.ebuild => portage-2.3.91.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)