qubes-issues
qubes-issues copied to clipboard
Qubes backup freezes while file selection dialog is open
Qubes OS 4.2.4
Brief summary
While the file selection dialog is open (either to select backup destination, or to unmount the backup drive once the backup is complete), the backup and Qube Manager freezes-- it doesn't even redraw its screen, as can be seen if you don't have a compositor (see screenshot below).
Steps to reproduce
- Open backup dialog
- Set target Qube to some VM
- Select
...to choose a file on the VM
Expected behavior
File selection dialog runs asynchronously (Qube Manager continues to run normally).
Actual behavior
Window is not redrawn when painted over.
Additional information
While this issue only causes confusion, the issue of the backup's VM operations not running asynchronously that is highlighted here may be behind other issues: #6537, #9452, #9739.
Looks like backup/restore isn't running in a dedicated thread, but maybe Qube Manager should even spawn a qubes-backup / qubes-backup-restore subprocess? Both Qube Manager and backup/restore are long-running and pretty complex. Spawning a separate process would insulate them from each other's failures, and a one or two second launch delay doesn't seem too bad to me.
An alternative to subprocess is PyQt6.QtCore.QProcess. It is a better choice in some cases. I used it 3 months ago to launch Create New Qube in a separate non-blocking process which does not block the main Qube Manager:
https://github.com/alimirjamali/qubes-manager/commit/04de057360ee1987ffc15e381d09194a97b799b8#diff-94c190b037ce8cd77692e9f511742b65105e4c2ee1dd11a872fb9cd963f3877a
It is easy; however, looking how I did it at that time, how I coded it to kill the Create New Qube QProcess if the main Qube Manager is closed is a little bit harsh. I should have coded it to minimize the Qube Manager and wait for the QProcess to finish (closed by user) gracefully. This will be absolutely necessary for Backup/Restore as their processes are very long.