Initialize asyncio event loop before using it#723
Initialize asyncio event loop before using it#723alimirjamali wants to merge 1 commit intoQubesOS:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #723 +/- ##
==========================================
+ Coverage 70.55% 70.66% +0.10%
==========================================
Files 61 61
Lines 13616 16766 +3150
==========================================
+ Hits 9607 11847 +2240
- Misses 4009 4919 +910
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
qubes/vm/__init__.py
Outdated
| self._qdb_connection_watch = qubesdb.QubesDB(self.name) | ||
| if loop is None: | ||
| loop = asyncio.get_event_loop() | ||
| loop = asyncio.new_event_loop() |
There was a problem hiding this comment.
During normal execution, at this point the loop surely is running already, so this change should not be necessary (or maybe it can be changed to get_running_loop()?).
What I'm not sure is there is a loop running in tests reaching this function, but this should be easy to find, and create the loop in those cases.
There was a problem hiding this comment.
Ok. I changed this one toget_running_loop.
Python 3.14 (in Fedora 43) throws RunetimeError if event loop is not initialized before using it. Resolves: QubesOS/qubes-issues#10188
cd49dc6 to
7e4a837
Compare
|
Nice contribution! What's still needed for Python 3.14? |
I am not certain. Some of the pending issues are tracked on the main Fedora 43 issue. Like this one. |
|
Thank you! |
Actually this is also ready for review. The only issue is lack of time. More information here. |
|
This PR is for dom0, and there are no plans to change Python version in R4.3 dom0 (it will stay at 3.13). This PR may be useful only for the future (R4.4 and beyond). |
|
What does may be useful mean? |
|
Yes, but at this time "main" branch is open only for changes that are necessary for R4.3. |
|
I couldn't find this information in the README, only the |
|
See https://doc.qubes-os.org/en/latest/developer/releases/version-scheme.html#release-schedule |
|
PipelineRetry |
|
openQArun MACHINE=64bit |
|
With this PR, qubesd fails to start: :( |
|
Seems to be the only place where a new loop hasn't been initialized yet: loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)Those breaking changes are surely not making it easier to use asyncio 😄 |
Python 3.14 (in Fedora 43) throws RunetimeError if event loop is not initialized before using it.
Resolves: QubesOS/qubes-issues#10188