ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
761 stars 912 forks source link

get_num_connections() does not drop after unregistering subscriber on Noetic #2210

Open tony-p opened 2 years ago

tony-p commented 2 years ago

Seems to be same issue as #526 (Indigo) #813 (Kinetic) . On #526 the most recent comment also references Melodic (since closing). However I'm experiencing it on Noetic

has 1 connections
Info:
Type: <Topic Type>

Publishers: 
 * <Publisher>

Subscribers: None

Dump from term for get_num_connections() and rostopic.get_info_text with instance specific type/connection info replaced by <x>

Topic is latched

Update: I have tried to create a minimal working example, and with happy flow I can't repeat it. One thing that is still different to the implementation where I see the issue is the publishing node has already received the shutdown signal (via rosnode.kill_nodes(node_name), and is processing pre shutdown hooks. Subscriber that is unregistering has not received shutdown signal.

Creating a shutdown hook and then calling rospy.signal_shutdown() in the node also doesn't seem show the issue in a minimal working example