Open realtime-neil opened 5 years ago
Obviously this behaviour isn't ideal, especially the raciness of it. However, I'm not sure there's much that can really be done at this point, particularly given that working around the issue is so trivial.
If you know upfront that you're invoking multiple roslaunch
instances (eg, from multiple systemd units or whatever), it's on you to add the --wait
flag to all but one of them, or add it to all of them, and use your external process management system to run a standalone roscore
.
Perhaps the docs should just be updated to make this expected usage more clear?
@mikepurvis , I think we agree. I wasn't expecting the introduction of some host-wide locking mechanism, but I do think the documentation should sport an extremely visible caveat that warns users off the mistaken notion that a roslaunch
ed rosmaster
is a guaranteed singleton.
@mikepurvis , how does one effect a change to the linked documentation? Should I register to edit the wiki?
Yup, go for it! Unfortunately anonymous edits had to be disabled many moons ago on account of the spam.
I've updated the documentation with a note about the roscore singleton (or lackthereof) and a link back to this ticket.
Diff: here.
Here's a thing I can reproduce with some regularity (names changed to protect the guilty):
Note how there are two
rosmaster
processes running. Note also how the firstroslaunch
is tied torosmaster
it started, while the second and thirdroslaunch
are tied to therosmaster
the thirdroslaunch
created.This behavior would directly contradict the following statement:
--- https://wiki.ros.org/roslaunch#roscore
Clearly, there is some gap between the instant
roslaunch
checks for an extantrosmaster
and the instantroslaunch
starts arosmaster
. Moreover, this gap is not being protected by host-wide mutex.