'Event loop is closed' while calling status from API more that once
See original GitHub issueHow to reproduce:
from packit.config import Config
from packit.cli.utils import get_packit_api
from packit.local_project import LocalProject
from packit.utils import get_repo
packit_onboarded_projects = ['https://github.com/packit-service/packit', 'https://github.com/packit-service/ogr']
for p in packit_onboarded_projects:
packit_cfg = Config.get_user_config()
repo = get_repo(p)
packit_local_project = LocalProject(repo)
packit_api = get_packit_api(config=packit_cfg, local_project=packit_local_project)
packit_api.status()
Expected output: Status is printed for both packit and ogr
Actual output:
'upstream_project_name' configuration key was renamed to 'upstream_package_name', please update your configuration file
'upstream_project_name' configuration key was renamed to 'upstream_package_name', please update your configuration file
Traceback (most recent call last):
File "/home/dhodovsk/logs/packit_status_error.py", line 14, in <module>
packit_api.status()
File "/home/dhodovsk/.local/lib/python3.7/site-packages/packit/api.py", line 567, in status
self.status_get_updates(status),
File "/usr/lib64/python3.7/asyncio/tasks.py", line 746, in gather
fut = ensure_future(arg, loop=loop)
File "/usr/lib64/python3.7/asyncio/tasks.py", line 608, in ensure_future
task = loop.create_task(coro_or_future)
File "/usr/lib64/python3.7/asyncio/base_events.py", line 398, in create_task
self._check_closed()
File "/usr/lib64/python3.7/asyncio/base_events.py", line 475, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine 'PackitAPI.status_get_updates' was never awaited
sys:1: RuntimeWarning: coroutine 'PackitAPI.status_get_builds' was never awaited
sys:1: RuntimeWarning: coroutine 'PackitAPI.status_get_up_releases' was never awaited
sys:1: RuntimeWarning: coroutine 'PackitAPI.status_get_dg_versions' was never awaited
sys:1: RuntimeWarning: coroutine 'PackitAPI.status_get_downstream_prs' was never awaited
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
"Asyncio Event Loop is Closed" when getting loop
On Windows seems to be a problem with EventLoopPolicy, use this snippet to work around it: asyncio.set_event_loop_policy(asyncio.
Read more >Python 3.8+ raises "RuntimeError: Event Loop is closed" on ...
I assume this is yet another strange issue with asyncio's stream.close() - it schedules the closing of the socket but it's not guaranteed...
Read more >Event Loop — Python 3.11.1 documentation
Close the event loop. The loop must not be running when this function is called. Any pending callbacks will be discarded. This method...
Read more >Don't Block the Event Loop (or the Worker Pool) - Node.js
If a thread is taking a long time to execute a callback (Event Loop) or a task (Worker), we call it "blocked". While...
Read more >18.5.1. Base Event Loop — Python 3.6.1 documentation
Schedule all currently open asynchronous generator objects to close with an aclose() call. After calling this method, the event loop will issue a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
packit
Fedora package to get the dependencies.I saw it multiple times in the tests as well and since it will be used outside of the packit it will be good to have a stable API for that – I’ll create an issue.
edit: created https://github.com/packit-service/packit/issues/571