forked from jpouellet/qubes-desktop-linux-common
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handlers for property/feature set events cannot be async functions, so they schedule async functions in the background (without waiting for results). This leads to various "coroutine ... was never awaited" warnings, but also in some cases to race conditions between the handlers. The latter is especially the case when removing a qube - if any appmenu action is still running, qube will be removed without waiting for it to complete, leading to either re-creating files that were just removed, or just failing the operation. This was found by a change in tests that now unset "guivm" property before removing a qube. That guivm change triggers appmenu update in background, but said qube is removed shortly - before the operation would complete. Fix this by collecting tasks schedule in background on a per-vm list, and awaiting them when applicable - on domain shutdown (as a non time sensitive place that can ryn async code), and before removing files (to avoid above-mentioned race). And also, collect done tasks (which can be done also in non-async context) before scheduling another.
- Loading branch information
Showing
1 changed file
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters