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

core: dbus: track bus names per unit #887

Closed
wants to merge 1 commit into from

Conversation

zonque
Copy link
Member

@zonque zonque commented Aug 5, 2015

Currently, PID1 installs an unfiltered NameOwnerChanged signal match, and
dispatches the signals itself. This does not scale, as right now, PID1
wakes up every time a bus client connects.

To fix this, install individual matches once they are requested by
unit_watch_bus_name(), and remove the watches again through their slot in
unit_unwatch_bus_name().

If the bus is not available during unit_watch_bus_name(), just store
name in the watch_bus hashmap, and let bus_setup_api() do the installing
later.

Currently, PID1 installs an unfiltered NameOwnerChanged signal match, and
dispatches the signals itself. This does not scale, as right now, PID1
wakes up every time a bus client connects.

To fix this, install individual matches once they are requested by
unit_watch_bus_name(), and remove the watches again through their slot in
unit_unwatch_bus_name().

If the bus is not available during unit_watch_bus_name(), just store
name in the 'watch_bus' hashmap, and let bus_setup_api() do the installing
later.
@poettering
Copy link
Member

Given that the core doesn't need to know about all this and that only one service type (services) actually cares about this I think this really should be moved out of unit.c and done entirely within service.c. The callback should be removed from the unit vtable then.

@poettering
Copy link
Member

Ah, well, I take that back, due to the the global list of names to deal with the fact that we are not always connected to a bus...

@poettering
Copy link
Member

Besides the quirky error handling looks good.

@poettering poettering added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Aug 6, 2015
@zonque
Copy link
Member Author

zonque commented Aug 6, 2015

Obsoleted by #894

@zonque zonque closed this Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pid1 reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks sd-bus
Development

Successfully merging this pull request may close these issues.

None yet

2 participants