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

Clinton H Goudie-Nice commented on OAK-2752:
--------------------------------------------

+1 for Will's patch.

This is a particularly problematic loop, as one stuck thread in this loop ends 
up blocking any additionally callers (and in a stack trace that I am looking 
at, there are many)

This problem becomes compounded because the threads waiting for this monitor 
are also holding other object monitors and other types of semaphores further up 
the stack, which results in a variety of other problems including log in issues 
to JCR.

As the problem continues, more and more threads pile up, blocking in more and 
more areas.

> SegmentIdTable can sometimes hang when calling getSegmentId(msb, lsb)
> ---------------------------------------------------------------------
>
>                 Key: OAK-2752
>                 URL: https://issues.apache.org/jira/browse/OAK-2752
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: oak-core
>    Affects Versions: 1.2
>            Reporter: Will McGauley
>            Priority: Critical
>             Fix For: 1.2.1
>
>         Attachments: OAK-2752.patch
>
>
> The while loop getSegmentId(msb, lsb) loops forever in the situation where 
> the segment id is not found. 
> Looping occurs from 'first' and loops to the end of the SegmentId references, 
> and then loops back to first.  If the segmentid is not found in any of the 
> referenced items then looping continues past 'first' again and loops for 
> eternity through all the references.
> See attached patch for possible fix to break out of the loop after getting 
> back to 'first' again.
> note: I have tested this patch on my system and it seems to work, but I do 
> not know if the patch provides the best fix, I am a bit new to this code.  
> The most important part of the patch would be the break condition from the 
> loop so the loop does not continue after testing each reference



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to