jonaitken/KUKA-IIWA-API

Thread safety issue

Closed this issue · 1 comments

Hi,

I noticed there might be a race condition in line 194 of server_V30032017.py. Python's socket library is not thread safe and we cannot ensure ROS_API will receive the command in exact order we send. I tried to execute demo1_BasicMotions.py but everytime the execution result is different.

Also ROS publisher in the client_lib.py drops the oldest message if server_V30032017.py's subscriber does not consume the ROS message fast enough. The queue length in client_lib.py also caused some problem when sending commands when executing demo1_BasicMotions.py

Thank you, I'll have a look and add into the list of changes for the next revision. We've been preparing an update at present, and this looks like something we should refactor.

Agreed to on queue length - I've tended to be fairly sparse with sending commands, but I'm aware where this issue is coming from. I'll mark closed for now and add to our "to do" list!