dbus2 / zbus-old

Rust D-Bus crate.
https://gitlab.freedesktop.org/dbus/zbus
Other
49 stars 13 forks source link

[zbus-3.4] Regression due to `ObjectServer` change of behavior #299

Closed zeenix closed 1 year ago

zeenix commented 1 year ago

In GitLab by @lucab on Nov 14, 2022, 17:13

Our CI at https://github.com/coreos/zincati/pull/886 caught a regression when updating from zbus-3.3 to zbus-3.4. Client tests are now timing out when trying to call the server, which is implemented on top of zbus. From an out-of-band chat, this seems to be due to following change of behavior:

ObjectServer to only serve methods destined to its connection.

This seems to be an unintended side-effect of the way that the consumer does object-server setup: https://github.com/coreos/zincati/blob/3a4f579a357d4aff56cc6b9a8e512fd105b40564/src/dbus/mod.rs#L36-L54

Moving forward it seems that the following changes would be useful:

zeenix commented 1 year ago

add a ConnectionBuilder::name_with_flags() method, so that both name and behavior-flags can be specified, without the need to go through DBusProxy::request_name()

This part turned out to be harder than I thought. Allowing to queue the name, means we'll have to track the name ownership but only until user releases the name. I've a WIP patch for it locally. Will attempt tomorrow again if I can make it work reliably.

zeenix commented 1 year ago

Actually come to think of it, this part is not really required to fix the regression so I'll focus on getting releases out with the fix included.

Connection::request_name_with_flags would be nice but I think it'll have to wait.

zeenix commented 1 year ago

mentioned in commit c729b6c746fc5bfdf390056d194f2060c140c741