Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-app-shutdown-idle incorrectly monitors idleness and shuts down prematurely #9832

Open
austinche opened this issue Mar 9, 2025 · 0 comments
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: other needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information.

Comments

@austinche
Copy link

Qubes OS release

Qubes OS 4.2

Brief summary

The way that idleness is monitored fails for apps that quickly map/unmap windows. For example, zoom does not open unless there's already an open window to prevent the idleness monitor from shutting everything down.

Steps to reproduce

  1. Install zoom into a qube and enable shut down when idle for more than 15 minutes
  2. Make sure no other windows are open for the qube
  3. Run zoom from the launcher

Expected behavior

For zoom to open and the qube to be still running

Actual behavior

The qube immediately shuts down

Additional information

The function monitor_idleness in qubesidle/idleness_monitor.py does not work as intended. It assumes that all state changes go from idle->non-idle->idle but it is possible for state changes to happen and yet for the idle state to remain the same. There are possible race conditions. It it is possible for the function to return, shutting down the qube, with idleness of much less than 15 minutes.

What I see happen, if I remove the power off code, when launching zoom is roughly the following:
window map event -> state change -> detected idle (i.e. window has already been unmapped)
window unmap event -> state change -> detected idle (would power off at this point)
window map and unmap events -> state change -> detected idle (i.e. window quickly mapped/unmapped)

It would be better to check that it is both idle and it has been 15 minutes since the last time it was idle and not to assume that two consecutive idle checks means the system is idle.

@austinche austinche added the P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. label Mar 9, 2025
@andrewdavidwong andrewdavidwong added C: other needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. affects-4.2 This issue affects Qubes OS 4.2. labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: other needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information.
Projects
None yet
Development

No branches or pull requests

2 participants