set signal_status to 0 in rclcpp::init#152
Conversation
|
Also the signal handling is not restored. And there is a temporal gap after calling |
What are you referring to? |
|
Afaik inoking |
|
You mean in the middleware or within our code (like the multi threaded executor)? |
|
Any code calling |
|
Yeah but in most cases I think it would be ok, since init is not going to be called again until they are done (until what ever spin function called is done). A bigger concern for me is what an |
|
Right now, https://github.com/ros2/rmw_connext/blob/master/rmw_connext_shared_cpp/src/shared_functions.cpp#L119 Do we intend for |
|
If our API does not contain a We could also argue to remove But having only one side seems wrong to me. |
|
It's not clear to me that |
|
OK, this is what I'm hearing: We should add an We should decide if calling If multiple calls to init/shutdown is permitted, we should add This might be more controversial: if multiple calls to init/shutdown are NOT permitted, there should be a function ( I'm not sure what the path I should take in this PR is. I just want a way of interrupting |
|
Imo multiple calls should be permitted. But only alternating - never two consecutive calls of the same function. One difficult question is: are the calls permitted immediately after each other or might there be some "delay" before they can be called again? |
|
Ideally, Middleware threads are more problematic because we're not sure what threads are spawned in the middleware and when they join. We could make it a requirement of (Actually, I'm pretty sure some Opensplice threads don't get joined until the process finishes--like the garbage collector--or that might be a different process.) We could make it a requirement that the next rclcpp::init must happen in an independent scope of the previous call to rclcpp::init/rclcpp::shutdown. This seems prone to user error, however. So, I don't know how to answer that questions besides "it seems to work without requiring a wait in our current implementation". |
|
@jacquelinekay and I talked off line and I suggested that we just add a Separately we need to come up with a completely strategy for the library lifecycle and implement that. |
|
Should I just close this PR then? The discussion seems like it will be useful later. Maybe start a new issue about init/shutdown and invalidating rclcpp entities and link here? |
* remove fprintf, use logging macros * consistent includes
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
shutdownshould be the inverse function ofinit. This PR sets state that is set inshutdownback to what its starting value should be ininit, to make the functions more symmetric.Ideally, calling
init, shutdown, initshould have the same effect as callinginitonce.