Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

No error for ServiceServer on duplicate topic #272

Open
broesdecat opened this issue Mar 23, 2018 · 2 comments
Open

No error for ServiceServer on duplicate topic #272

broesdecat opened this issue Mar 23, 2018 · 2 comments

Comments

@broesdecat
Copy link

Hi,

I observed the following:

  • a serviceserver A running on servicename X, which is properly receiving calls from a serviceclient
  • another serviceserver B is started, accidentally also on X
  • logging info reports initialization of B as succesful, neither does any other node complain
  • messages sent by the client keep arriving only at A

Is this the expected behavior?

Thanks!
Broes

@jubeira
Copy link

jubeira commented Mar 26, 2018

Hi @broesdecat,

Thanks for the observation. It doesn't look like expected behavior to me; at least I would expect some sort of warning/ error message. Ideally, the behavior should be the same as in rospy or roscpp (I would start by checking that).

If this is a problem for you, feel free to open a PR with a proposed fix. Otherwise, I will take a look when I have some time (it might take a bit long).

@SpyrosKou
Copy link

SpyrosKou commented Jun 18, 2022

Hi,
I would like to add some information on this issue.

When the two service servers A and B that have the same service name X are started on the same Node the issue does not occur. I only occurs when service servers A and B are started on different Nodes.
When the two service servers are started on the same Node a DuplicateServiceException is thrown.

The existence of two service servers A and B using the same service name X on the same Node is tested in org.ros.node.service.ServiceIntegrationTest.

The rosjava MasterServer when a new service B is registered that uses an existing service name X, unregisters the previous service instance A and registers the new one (B) under the same name (X), Assuming (as written in the comments) that the service instance A was stopped and the new service server B replaces it.

However the following are also valid:

  1. The MasterServer does not stop node with service server A when a new Service Server B with the same name apperas. So if Service Server A with Service Name X was not stopped as assumed, the server will be still running.
  2. The old clients that have already been created to call Service Server A are not informed
  3. Creating new clients from a new node actually seems to still contact ServiceServer A although Service Server B should be contacted.

Best regards,
Spyros

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants