Getting a property change sometimes blocks forever
Hello, thanks for the wonderful library. I've been having an issue where things freeze up when using zbus
. I narrowed this down to PropertyChanged::get
calls blocking forever. This only seems to happen sometimes, but is much more common when using a multi-threaded tokio runtime.
This piece of code reproduces the issue consistently for me and will get stuck forever:
use futures_util::StreamExt;
use zbus::{zvariant::OwnedObjectPath, Connection};
#[zbus::dbus_proxy(
interface = "net.connman.iwd.Station",
default_service = "net.connman.iwd"
)]
trait Station {
#[dbus_proxy(property)]
fn connected_network(&self) -> zbus::Result<OwnedObjectPath>;
}
#[tokio::main]
async fn main() {
let connection = Connection::system().await.unwrap();
let station = StationProxy::builder(&connection)
.path("/net/connman/iwd/0/33")
.unwrap()
.build()
.await
.unwrap();
let mut changes = station.receive_connected_network_changed().await;
while let Some(change) = changes.next().await {
println!("getting change");
let _result = change.get().await;
println!("got change");
}
}
When I change WiFi networks a couple of times, this gets stuck forever waiting for the change.get()
call to resolve. If I change this example to use a single threaded tokio executor it never gets stuck, so I'm guessing this isn't expected behavior.