-
Notifications
You must be signed in to change notification settings - Fork 162
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
rcl_configure_logging
and rcl_logging_fini
are called multiple times when creating multiple contexts
#551
Comments
let me take care of this, will get back to you. Best |
my thoughts are the followings,
just let me know if i got anything missing and wrong. Best, |
Sounds good, thanks!
Yeap, I agree. Alternativly, we could have some context dependent logging configs, but I don't think that's a good idea (and definetly, much more work).
That sounds reasonable, though it's not required. You can skip that in the first iteration, in order to minimize changes in upstream packages.
I would ensure thread safety in logging init-fini functions, to avoid strange runtime errors.
Sounds good. Besides that, it would be good to show a warning when logging is initialized more than once, passing different |
@fujitatomoya are you planning to contribute in this one? |
yes, i am going to do it, i am positive that i can do that in this week. it was just hard to squeeze time...sorry to be late to get back to you. |
could you share your thoughts on #560 ? i am not so sure that we need to ensure thread safe on this function, maybe warning should be enough. |
i guess that we can close this since #560 is merged. |
Yes, #579 ros2/rclpy#518 and ros2/rclcpp#998 fixed this. It would nice too modify the logger so that its configuration isn't global, but that's a different issue. |
Feature request
Feature description
Currently, if many contexts are created, rcl_logging_configure is called many times, overriding preexisting configurations silently.
Same happens with rcl_logging_fini. That destroys the logger when the first context is destructed.
The logger should be only initialized once, and initialization of future contexts should be ignored logging a warning (or handling the error somehow).
Implementation considerations
To avoid destructing the logger at the first call, an initialization count can be implemented.
The logger should be destroyed after
rcl_logging_destroy
was called the same times that init.Note
Check if something similar may be happening with other "global" configurations.
The text was updated successfully, but these errors were encountered: