Replies: 1 comment
-
I'm not sure how a timeout wrapper can get you access to the error but when the properties are being cached (the default), zbus can't assume the the missing destination is an error because the destination can come and go. Try disabling the caching through the proxy builder and see if that gives you an error (I think it should).
I'd suggest disabling the caching but if that can't/doesn't work for you, you can use |
Beta Was this translation helpful? Give feedback.
-
Hi,
tl;dr, How to determine is a service is available when using proxy macros (or otherwise)?
Longer story -- I have a service that queries NetworkManager (see proxy usage below). A call to the
state()
method hangs and blocks for ever (even usingawait
). There appear to be no other errors when making a connection or created the socket. I eventually used tokio::time::timeout() to wrap thestate()
method call and got the following error which gave me the clue that my service needed to wait longer(Ok(Err(MethodError(OwnedErrorName("org.freedesktop.DBus.Error.ServiceUnknow n"), Some("The name org.freedesktop.NetworkManager was not provided by any .service files"), Msg { type: Error, serial: 12, sender: UniqueName("org.freedesk top.DBus"), reply-serial: 11, body: Signature("s"), fds: [] })))
My service does work if my service is started after NetworkManager, however i'd prefer it to be able to query dbus to determine if a service is available, or have the async function return with an error that the service is not available. I feel like using
tokio::time::timeout()
is not the intended strategy to determine a service's availability. So How does one pragmatically determine if a service is available?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions