-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition between capability_server start and calling "start_capability" #82
Comments
I see your point, perhaps there should be a service which allows you to check the state of the server. Basically you would need a service like I don't have a lot of time to spend on this, but given the above description it should be possible for someone other than me to make a pull request. I'll eventually get to it, but not at the moment. |
Thanks for your input! Is there no way to defer the creation of the other services until the server is ready? That would make it zero effort on the part of a user. |
Without the blocking call to the service, there will always be a race condition between the server being ready and the service server being made available. It might be possible to create the service server after the server is ready, but I'd have to dig into the code base to know for sure. Either way the service should do something, and it might as well block until the server is ready. |
Move event subscribing ahead of service advertising. Fix #82.
I'm going to reopen this as #83 improved the situation, it's not clear to me that it is completely sufficient. |
If capability server is launched after another node that calls the "start_capability" service as soon as it's available, capability_server will sometimes store "None" as the PID of the launched capability. You get an error like:
Echoing the "events" topic when this happens shows that the "launched" event happens before the "server_ready" event:
I am able to reproduce this about 25% of the time with the following small node:
I considered listening for the "server_ready" event before trying to call the service, but that causes issues if the client node start long after the "server_ready" event happens because it will miss this event.
The text was updated successfully, but these errors were encountered: