Closed zeenix closed 1 year ago
In GitLab by @swsnr on Sep 4, 2021, 14:10
PS: Out of curiosity why does zbus use ReplaceExisting as flag in addition to DoNotQueue? Shouldn't the latter be sufficient to ensure exclusive access?
According to its
ObjectServer::request_name
requests exclusive access to the name, so I'd expect it to fail if the requested name is already taken.
Indeed, that should be the case so this is a bug.
DoNotQueue
says to the bus that if the name is already taken, don't bother waiting but rather just fail. ReplaceExisting
will only be able to replace an existing owner if that owner has specified AllowReplacement
flag. Probably it could be argued that ReplaceExisting
as a default is not a great idea but given that most services don't specify AllowReplacement
, in practice this flag doesn't do much in most cases.
mentioned in commit 85f215dbd05e20b31c4f892b3c993bc8f5c5bae8
In GitLab by @swsnr on Sep 4, 2021, 14:07
According to its
ObjectServer::request_name
requests exclusive access to the name, so I'd expect it to fail if the requested name is already taken.However it doesn't fail because it never actually checks the reply from the broker, and since it also doesn't return the
RequestNameReply
I can't even check myself.Is this intended?