Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • D dconf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • 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
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • dconf
  • Merge requests
  • !5

Engine: account for multiple simultaneous subscriptions to the same path

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Daniel Playfair Cal requested to merge daniel.playfair.cal/dconf:bug/multi-sub into master Jul 25, 2018
  • Overview 49
  • Commits 5
  • Pipelines 4
  • Changes 4

Fixes #2 (closed)

Motivation

There is currently a bug in how subscriptions are handled which causes clients to sometimes not be notified about changes to the database that they have subscribed to: #2 (closed)

Background

It is possible for clients to have many subscriptions to the same key path. Before !1 (merged), this was handled simply by adding/removing the corresponding D-Bus match rule every time a client unsubscribed. !1 (merged) however incorrectly assumes that there is only one subscription to each path, and that the client library handled deduplicating subscriptions, when it fact is was D-Bus that handled this.

Changes

  • Instead of storing a set of paths in the pending/establishing and active/watched states like !1 (merged), store the number of subscriptions for each path in a hash table. This generalises to multiple simultaneous subscriptions, since the count can be increased when subscribing and decreased when unsubscribing to ensure that the D-Bus match rule (only one) is removed when the number of client subscriptions falls to zero.
  • Add a lock subscription_count_lock around access to these hash tables, to ensure that the process of changing a subscription's state is atomic and thread safe.
  • Add items to dconf_engine_unref which were previously missing
  • Add debug logging statements

TODO

  • Add/extend unit tests to more thoroughly test this new behaviour
  • Add spaces before function parentheses and fix other syntax related style issues
Edited Aug 01, 2018 by Daniel Playfair Cal
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: bug/multi-sub