Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831991 - sys-apps/portage: portage.process.run_exitfuncs Bad file descriptor in _thread_weakrefs_atexit for API consumer
Summary: sys-apps/portage: portage.process.run_exitfuncs Bad file descriptor in _threa...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-24 20:11 UTC by Zac Medico
Modified: 2022-01-24 20:11 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 2022-01-24 20:11:45 UTC
I've seen this portage.process.run_exitfuncs error intermittently from a script that uses the portage API:

> ====================================
> Error in portage.process.run_exitfuncs
> 
>   File "/usr/lib/python3.8/site-packages/portage/process.py", line 213, in run_exitfuncs
>     func(*targs, **kargs)
>   File "/usr/lib/python3.8/site-packages/portage/util/futures/_asyncio/__init__.py", line 320, in _thread_weakrefs_atexit
>     loop.close()
>   File "/usr/lib/python3.8/asyncio/unix_events.py", line 58, in close
>     super().close()
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 92, in close
>     self._close_self_pipe()
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 100, in _close_self_pipe
>     self._ssock.close()
>   File "/usr/lib/python3.8/socket.py", line 500, in close
>     self._real_close()
>   File "/usr/lib/python3.8/socket.py", line 494, in _real_close
>     _ss.close(self)
> [Errno 9] Bad file descriptor
> ====================================
> 
> Error in atexit._run_exitfuncs:
> Traceback (most recent call last):
>   File "/usr/lib/python3.8/site-packages/portage/process.py", line 213, in run_exitfuncs
>     func(*targs, **kargs)
>   File "/usr/lib/python3.8/site-packages/portage/util/futures/_asyncio/__init__.py", line 320, in _thread_weakrefs_atexit
>     loop.close()
>   File "/usr/lib/python3.8/asyncio/unix_events.py", line 58, in close
>     super().close()
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 92, in close
>     self._close_self_pipe()
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 100, in _close_self_pipe
>     self._ssock.close()
>   File "/usr/lib/python3.8/socket.py", line 500, in close
>     self._real_close()
>   File "/usr/lib/python3.8/socket.py", line 494, in _real_close
>     _ss.close(self)
> OSError: [Errno 9] Bad file descriptor
> Exception ignored in: <function BaseEventLoop.__del__ at 0x7f5491ddf700>
> Traceback (most recent call last):
>   File "/usr/lib/python3.8/asyncio/base_events.py", line 656, in __del__
>   File "/usr/lib/python3.8/asyncio/unix_events.py", line 58, in close
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 92, in close
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 99, in _close_self_pipe
>   File "/usr/lib/python3.8/asyncio/selector_events.py", line 276, in _remove_reader
>   File "/usr/lib/python3.8/selectors.py", line 190, in get_key
>   File "/usr/lib/python3.8/selectors.py", line 71, in __getitem__
>   File "/usr/lib/python3.8/selectors.py", line 225, in _fileobj_lookup
>   File "/usr/lib/python3.8/selectors.py", line 42, in _fileobj_to_fd
> ValueError: Invalid file descriptor: -1