Skip to content

Package to illustrate issue with closing Zenoh session in the Context's destructor

License

Notifications You must be signed in to change notification settings

Yadunund/rmw_zenoh_shutdown_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

rmw_zenoh_shutdown_test

Package to illustrate issue with closing Zenoh session in the Context's destructor.

For context see: ros2/rmw_zenoh#170

As explained in this comment, the hypothesis is that the tokio runtime in Zenoh panics when the Zenoh session is closed within rclcpp::Context's destructor that is triggered when the program terminates. Perhaps given the order of static initialization, the Thread Local Storage is cleared before the destructor runs.

To illustrate this behavior, this repo has two excutables, main_with_shutdown and main_without_shutdown, where each creates an instance of a ROS node that does nothing before exiting. The only difference is that main_with_shutdown, calls rclcpp::shutdown() before exiting. The main_without_shutdown executable will always panic.

To test:

Start the Zenoh router.

ros2 run rmw_zenoh_cpp rmw_zenohd

Run main_with_shutdown,

export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run rmw_zenoh_shutdown_test main_with_shutdown

Run main_without_shutdown,

export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run rmw_zenoh_shutdown_test main_without_shutdown

About

Package to illustrate issue with closing Zenoh session in the Context's destructor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published