Skip to content

core: re-sync bus name list after deserializing during daemon-reload#2216

Merged
poettering merged 1 commit intosystemd:masterfrom
zonque:nameownerchanged
Dec 23, 2015
Merged

core: re-sync bus name list after deserializing during daemon-reload#2216
poettering merged 1 commit intosystemd:masterfrom
zonque:nameownerchanged

Conversation

@zonque
Copy link
Member

@zonque zonque commented Dec 23, 2015

When the daemon reloads, it does not actually give up its DBus connection,
as wrongly stated in an earlier commit. However, even though the bus
connection stays open, the daemon flushes out all its internal state.

Hence, if there is a NameOwnerChanged signal after the flush and before the
deserialization, it cannot be matched against any pending unit.

To fix this, rename bus_list_names() to manager_sync_bus_names() and call
it explicitly at the end of the daemon reload operation.

Fixes #2136

@jgehrcke
Copy link

Big thanks for tracking this down. Can you give an estimate about when this will land in a release? The issue solved by this PR severely affects service development work in recent CoreOS versions.

@zonque
Copy link
Member Author

zonque commented Dec 23, 2015

I doubt there will be another release this year. If you want to deploy it nevertheless downstream, you can just cherry-pick d8ccf5f and this one. Both are needed to fix the bug.

@poettering
Copy link
Member

Conceptually looks good to me, but needs an extra check i think, see above.

@poettering poettering added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Dec 23, 2015
When the daemon reloads, it doesn not actually give up its DBus connection,
as wrongly stated in an earlier commit. However, even though the bus
connection stays open, the daemon flushes out all its internal state.

Hence, if there is a NameOwnerChanged signal after the flush and before the
deserialization, it cannot be matched against any pending unit.

To fix this, rename bus_list_names() to manager_sync_bus_names() and call
it explicitly at the end of the daemon reload operation.
@zonque
Copy link
Member Author

zonque commented Dec 23, 2015

Right, thanks for spotting. I force-pushed an amended version.

poettering added a commit that referenced this pull request Dec 23, 2015
core: re-sync bus name list after deserializing during daemon-reload
@poettering poettering merged commit 7b8f930 into systemd:master Dec 23, 2015
@poettering
Copy link
Member

Thanks for fixing this! Merged!

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

Development

Successfully merging this pull request may close these issues.

Type=dbus NameOwnerChanged race condition

3 participants