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

Takahito Kikuchi edited comment on JCR-3958 at 4/7/16 10:24 AM:
----------------------------------------------------------------

[~un...@apache.org], I checked the code of your fix, then there does not seem 
to be any problems.
And I verified as following, then it works fine.

It was not easy to do async upload in order to return {{null}} of {{remove}} 
purposely, so instead I set a specified sentence such as 'abc' onto {{remove}} 
of {{Localcache}} you implemented this time so that we can check just the 
behavior.

{code:java}
                //if (asyncUploadCache.hasEntry(fileName, false)) {
                  if (asyncUploadCache.hasEntry(fileName, false) || 
fileName.contains("abc")) {
{code}

To compare your fix with the previous, I built the previous version with this 
same condition of specified sentence. The result is I could reproduce endless 
loop happened.

Next, I tried with your fix then it works fine. {{LocalCache}} with your fix 
can detect the entry with the specified sentence once only, then skip it to 
next. Also, I confirmed the cache purge runs well each time it reaches 
cachePurgeTrigFactor. That looks good.



was (Author: takahito.kikuchi):
[~un...@apache.org], I checked the code of your fix, then there does not seem 
to be any problems.
And I verified, then it works fine.

It was not easy to do async upload in order to return {{null}} of {{remove}} 
purposely, so instead I set a specified sentence such as 'abc' onto {{remove} 
of {{Localcache}} you implemented this time so that we can check just the 
behavior.

{code:java}
                //if (asyncUploadCache.hasEntry(fileName, false)) {
                  if (asyncUploadCache.hasEntry(fileName, false) || 
fileName.contains("abc")) {
{code}

To compare your fix with the previous, I built the previous version with this 
same condition of specified sentence. The result is I could reproduce endless 
loop happened.

Next, I tried with your fix then it works fine. {{LocalCache}} with your fix 
can detect the entry with the specified sentence once only, then skip it to 
next. Also, I confirmed the cache purge runs well each time it reaches 
cachePurgeTrigFactor. That looks good.


> Endless loop until async upload completes
> -----------------------------------------
>
>                 Key: JCR-3958
>                 URL: https://issues.apache.org/jira/browse/JCR-3958
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>    Affects Versions: 2.12.0
>            Reporter: Takahito Kikuchi
>            Assignee: Unico Hommes
>
> This is {{LocalCache#PurgeJob()}} issue.
> If the entry object in cache is removed successfully by cache.remove(), 
> cache.entrySet would be decreased then next entry will be retrieved and 
> removed. However, if the entry object is not removed due to the failure of 
> removing the file during async upload, the entry in cache would not be 
> removed, then the next entry would be the same entry again by the iterator 
> because the iterator is not changed still. Consequently, that causes endless 
> loop until async upload of the file completes. If the file is larger, the 
> endless loop will continue for a longer time. It's harmful.



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

Reply via email to