[ 
https://issues.apache.org/jira/browse/SOLR-6075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13999464#comment-13999464
 ] 

Anshum Gupta commented on SOLR-6075:
------------------------------------

The addTask(String map, TaskObject o, boolean limit) method reads in one 
statement and removes in the next. That was the reason I thought we should 
synchronize it. 
Collections.synchronizedMap ensures that statements like put(), remove() are 
thread-safe. There's no guarantee on a bunch of statements comprising of 
read/update operations together being thread-safe.

Also, you're correct, I accidentally synchronized it on the string. Thanks for 
noticing that!

> CoreAdminHandler should synchronize while adding a task to the tracking map
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-6075
>                 URL: https://issues.apache.org/jira/browse/SOLR-6075
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Anshum Gupta
>            Assignee: Anshum Gupta
>            Priority: Minor
>             Fix For: 4.9, 5.0
>
>         Attachments: SOLR-6075.patch, SOLR-6075.patch
>
>
> CoreAdminHandler should synchronize on the tracker maps when adding a task. 
> It's a rather nasty bug and we should get this in asap.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to