[ 
https://issues.apache.org/jira/browse/DIRSERVER-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721802#action_12721802
 ] 

Kiran Ayyagari commented on DIRSERVER-1377:
-------------------------------------------

Though theoretically all the above stands, implementation of the de/serializer 
under question is a bit simple because

 The JdbmTable (on which JdbmIndex is based) does an internal check about 
allowing duplicate keys, *iff* duplicates are allowed then
 it creates an AvlTree and stores the value(s) in it. Note that even if a key 
has a single value and the duplicates are allowed in a table
 then the value will be stored in a AvlTree. 
 If the size of this AvlTree increases beyond a threshold then this AvlTree 
values will be copied to a Jdbm BTree and the record Id is stored instead of 
 the AvlTree.

So the only values that need to be taken care by the serializer are 1. AvlTree 
or 2. BTreeRedirect (which holds the record Id of jdbm BTree)

--- Update about fix --

Have tried with the new serializer but that didn't solve the problem, IMO the 
issue is with the way the AvlTree is modified in the JdbmTable's put() and 
remove() methods.
To test this I have synchronized these methods and haven't encountered the NPE. 
This may not be an acceptable solution, but just to mention.

> Potential concurrency issue when adding/modifying/deleting entries at a high 
> rate
> ---------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1377
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1377
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>            Reporter: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.5
>
>
> When adding/deleting entries with many clients (a client add and delete an 
> entry many times), we may have some concurrency problem, as the index are 
> updated without concurrent acces protection.
> Synchronizing the classes where we update the index might help.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to