Closed obi-t4 closed 3 years ago
Hi! Thanks for submitting an issue!
I've looked into this, and I'm wondering if I've been able to reproduce the problem or not. What I found is the following: First I start up some docker containers running ROS. I run the script you've provided. The expected messages are printed to the console. Next I flip the use_lock
flag to True
and run the script (without restarting the containers). The expected messages are not printed to the console (although the script is not "stuck" exactly, it does run, but the printed output is not appearing). If I then restart the docker containers, maintain use_lock = True
and run the script again, the expected messages appear. Some logs within ROS seem to suggest that something is going wrong with the connection between the client and ROS, and I think it has to do with the publication rate. In fact, if I change wait_in_sec
to something larger, I can run the script resulting the in the expected output multiple times in a row with use_lock
as either True or False without restarting any containers. But these sorts of things are highly dependant on the machine the script and ROS is running on (https://answers.ros.org/question/318580/what-is-the-max-frequency-for-a-rospublisher-to-publish-message/). Does this help you at all?
Closing this due to inactivity, but feel free to re-open if you have additional findings/info.
Summary. publish stucks in a multiple threading environment. When
use_lock = True
(see below example), publish doesn't stuck.Expected Result
What you expected. subscribe callback should be called without getting stuck.
Actual Result
What happened instead. publish stucks.
Reproduction Steps
System Information
Operating System name and version, ROS version, etc. OS: ubuntu18.04 ROS: melodic