Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 162
    • Issues 162
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • NetworkManagerNetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !1345

[th/libnm-undeprecate-get-secrets] libnm: undeprecate nm_remote_connection_get_secrets()

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Thomas Haller requested to merge th/libnm-undeprecate-get-secrets into main Aug 24, 2022
  • Overview 5
  • Commits 1
  • Pipelines 2
  • Changes 2

Various synchronous methods (D-Bus calls) in libnm's NMClient API were deprecated. The problem is that NMClient contains a cache of D-Bus objects, and it gets updated by asynchronous events (D-Bus signals). Those events get only processed when iterating the GMainContext, but they are ordered.

When we perform a pseudo blocking D-Bus call with g_dbus_connection_call_sync(), then GDBus creates a temporary GMainContext, sends the request and iterates the internal context blocking for the response. That is, this reply is not synchrounized with the events that update the NMClient cache.

That is a problem for methods like nm_remote_connection_delete(), because you call blocking delete, but afterwards the object is still in the NMClient cache. That's why most blocking methods are deprecated.

While such blocking calls are therefore problematic, they can still be very convenient to call from a simple script, a test tool or the python REPL. See "examples/python/gi/nm-wg-set" which calls nm_remote_connection_get_secrets(), and it would be (unnecessarily) cumbersome to do the correct thing or using async API.

In particular, nm_remote_connection_get_secrets() doesn't retrieve an object that is in the NMClient cache in the first place. Sure, the result is out of order with the cache, but it's not obviously related and in most cases it wouldn't matter to the user. So undeprecate this function again.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: th/libnm-undeprecate-get-secrets