-
Notifications
You must be signed in to change notification settings - Fork 486
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
gazebo and gzserver return without error if gzserver is already running #1178
Comments
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). The check for an existing server is in void Master::Init, which throws an exception if detected. We could change the return type to Adding different logic to the gazebo startup would take a little more work. |
Original comment by andy_somerville (Bitbucket: andy_somerville). I think the important change would be in what is eventually returned to the system rather than what is returned internally. It seem the problem would be more in server_main.cc and gazebo_main.cc in that server_main catches all exceptions and without changing the return value to the system:
I think adjusting the catch to change the return value to -1 or some other specific error code could be part of a solution which would not break ABI. Though it is unclear if there are any users currently depending on the system to return a 0 even if a server is already running. |
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). I should have mentioned that |
Original comment by andy_somerville (Bitbucket: andy_somerville). I think that increases the number of options without needing to change the ABI. It would mean that any one of those in that line could catch the exception and turn it into a return code. In any case it seems like the final catch in any main should probably interpret an exception as an error and return non-zero accordingly. I can produce a patch/pull request for this, but unfortunately I'm not set up to easily build and test which might reduce the utility of me doing so. |
Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero).
I'm interested in this problem, I'll try to create a patch from Andy's comments. Let's see if can keep the ABI stable. |
Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero). The pull request #1085 should implement proper returning codes for gazebo 2.2 branch. About the message for another gzserver instance running, in gazebo3 (or default) I was able to see clearly the message in ~/ .gazebo/gzserver.log. For gazebo 2.2, the message is directly sent to the terminal. Both cases seems well documented to me. |
Original comment by andy_somerville (Bitbucket: andy_somerville).
Awsome!
I can verify that I also see the error message there. ~/.gazebo/gzserver.log was not a place I checked probably because I'm used to only checking the ROS logs which did not have said message, but that's more of a ROS specific problem which exists for all packages where ROS is not a direct dependency. That said, is there any reason errors don't also show up on stderr for gazebo3? |
Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero).
pull request merged. Reopen if needed. |
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
|
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
|
Original report (archived issue) by andy_somerville (Bitbucket: andy_somerville).
If a
gzserver
process is already running gazebo andgzserver
return without error. This is bad in that systems which pass arguments and expect respective action, systems which expectgzclient
to come up whengazebo
is run, or systems which expect the call to block until finish do not behave correctly.Specifically
roslaunch drcsim_gazebo atlas.launch
does not behave correctly when gzserver is already running.Optimal behavior is unclear, but a message to stderr seems prudent.
From the perspective of gzclient expectations:
gazebo
typically brings up both server and client when there isn't a server running. If a server is already running it seems that it should either bring up the client, or return an error.From the perspective of plugin loading, it's unclear if the plugins are in-fact loaded if gzserver is already running. If loading does not happen, gazebo should return an error since post conditions aren't meant.
The text was updated successfully, but these errors were encountered: