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
752 stars 911 forks source link

Add a workaround for a race condition while closing the socket (#2212) #2233

Closed madmage closed 2 years ago

madmage commented 2 years ago

This is not a fix but rather a workaround to avoid the exception when the socket is closed from two different threads (race condition). A proper fix would require to redesign the whole class to be thread safe. See https://github.com/ros/ros_comm/issues/2212.

jacobperron commented 2 years ago

Given the complexity involved in the code, I think this workaround is okay in lieu of a more involved fix.