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

Fix: org.gnome.SessionManager RuntimeError (Issue 276) #278

Merged
merged 5 commits into from
May 9, 2024

Conversation

fohrloop
Copy link
Owner

@fohrloop fohrloop commented May 9, 2024

Fixes the error with Gnome SessionManager based keepawake (#276)

DBus Adapters

  • All DBusAdapters now have to keep reference to the connection(s). This was required as if the connection instance was garbage collected, the inhibit cookie created by Gnome SessionManager was wiped.

  • The DBusAdapter class now has _get_connection(bus) method or getting a connection instance for an adapter.

  • The DBusAdapter subclasses now must implement a _create_new_connection(bus) method.

Other

Temporarily ignore warnings in tests/integration/conftest.py while running gc.collect(). This should be addressed later (likely as part of #277)

@fohrloop fohrloop merged commit d110be7 into dev May 9, 2024
14 checks passed
@fohrloop fohrloop changed the title Issue 276 gnome sessionmanager Fix: org.gnome.SessionManager RuntimeError (Issue 276) May 9, 2024
@fohrloop fohrloop deleted the issue-276-gnome-sessionmanager branch May 9, 2024 20:00
fohrloop added a commit that referenced this pull request May 18, 2024
fohrloop added a commit that referenced this pull request May 18, 2024
…77) (#282)

Previously: Using the org.gnome.SessionManager method repeatedly would
freeze system in 400-600 iterations.

Now: Get to ~2000 iterations before system freezes. 

Contents
--------
* Dbus connections are now closed. In addition, gc.collect() is called
  each time connection is closed (at least for now), as adding it helped
  to get more iteration cycles.
* Add warning to docs of org.gnome.SessionManager
* bonus: Some refactoring of dbus adapter tests + remove the temporary
  warning ignore introduced in #278.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant