yekigoc / rosjava

Automatically exported from code.google.com/p/rosjava
0 stars 0 forks source link

Removal of actionlib goal handles is not synchronized. #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a SimpleActionServer.
2. Submit a whole lot of actions in quick succession.
3. Wait for a concurrent modification of GoalHandles to occur.

What is the expected output? What do you see instead?

Exception in thread "Thread-38" java.util.ConcurrentModificationException\
    at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)\
    at java.util.AbstractList$Itr.next(AbstractList.java:343)\
    at org.ros.actionlib.client.GoalManager.updateFeedbacks(GoalManager.java:178)\
    at org.ros.actionlib.client.ActionClient.doFeedbackCallback(ActionClient.java:514)\
    at org.ros.actionlib.client.ActionClient$1.onNewMessage(ActionClient.java:198)\
    at org.ros.actionlib.client.ActionClient$1.onNewMessage(ActionClient.java:195)\

What version of the product are you using? On what operating system?

Latest trunk version of rosjava/actionlib.

Please provide any additional information below.

org.ros.actionlib.client.GoalManager is missing synchronized() blocks to guard 
access to listOfGoalHandles in the deleteGoalHandle(s) functions.  Eventually, 
this causes listOfGoalHandles to be modified while a status or feedback update 
is occurring.

Adding the synchronized() block should resolve the issue.  A proposed patch is 
attached.

Original issue reported on code.google.com by psi...@gmail.com on 2 Sep 2011 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
This has been fixed and pushed.

I thought about using a copy-on-write list, but decided against.

Original comment by khug...@google.com on 19 Jan 2012 at 5:28