[ros-users] Race condition in actionlib

Ryan Miller rmiller4589 at gmail.com
Fri Apr 1 01:55:48 UTC 2011


Because of a timing issue I can't quite pin down, actionlib
occasionally appears to exhibit a race condition. I found the problem
after adding callbacks to my client. I made each callback print when
it was called, and I found that quite often, the program would block
forever when I called waitForServer. The problem was that the client's
active callback was called but the server's execute method was never
called.

I have reduced the problem into a simple ROS package with a single
executable that I have attached. After running the node for a while, I
finally noticed the same problem. It's last output before blocking
was:

--- snip ---
Current State: ABORTED
Aborting.
Active.
Done.
Current State: ABORTED
Aborting.
Active.
--- snip ---

In my actual code, the condition happens extremely frequently, but I
found I could mitigate the problem by sleeping for one millisecond
before returning from the server's execute method. (I should warn you
that in the attached example, the problem almost never occurs).

Is this likely a bug, or might I doing something wrong? Any
suggestions would be appreciated. Thanks for the help.

-Ryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chores.tar.gz
Type: application/x-gzip
Size: 22132 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20110331/8445cfed/attachment-0003.bin>


More information about the ros-users mailing list