You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2016/05/02 12:29:12 UTC

[jira] [Commented] (SLING-5701) ChunkCleanUpTask runs into an endless loop with empty chunks

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

Stefan Egli commented on SLING-5701:
------------------------------------

[~shgupta], as this fix is concerning part of SLING-2707, would you be able to review the suggested patch? Also, I was wondering where did {{SlingPostChunkUploadTest}} of SLING-2707 go, did that make it into some IT? (I was keen to figure out if we have any testing that covers the cleanup)
Thx! 
/cc [~cziegeler]

> ChunkCleanUpTask runs into an endless loop with empty chunks
> ------------------------------------------------------------
>
>                 Key: SLING-5701
>                 URL: https://issues.apache.org/jira/browse/SLING-5701
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: Servlets Post 2.3.10
>            Reporter: Stefan Egli
>             Fix For: Servlets Post 2.3.12
>
>         Attachments: SLING-5701.patch
>
>
> Normally chunks created by the SlingFileUploadHandler are formatted the following way:
> {code}
> ./chunk_0_19999
> ./chunk_20000_39999
> ./chunk_40000_45123
> {code}
> However consider a chunk which is formatted as follows:
> {code}
> ./chunk_45124_45123
> {code}
> this will cause [SlingFileUploadHandler.getLastChunk|https://github.com/apache/sling/blob/ded7f8d657ff54711d6e9bd7d6f76cca67c89df6/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingFileUploadHandler.java#L487] to enter an endless loop as it repeatedly sets the {{startPattern}} to "{{./chunk_45124_45123}}" in the above case. Generally speaking, when you have a chunk named '{{chunk_n_n-1}}' {{getLastChunk}} will do an endless loop.
> You can also think of other scenarios where {{getLastChunk}} does an endless loop - basically, whenever the {{indexBounds[1]}} is lower than {{indexBounds[0]}} and hits an existing chunk name.



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