[ https://issues.apache.org/jira/browse/SLING-5701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15266383#comment-15266383 ]
Shashank Gupta commented on SLING-5701: --------------------------------------- [~egli] please find test class at https://github.com/shashank-itbhu/sling/blob/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/sling/post/SlingPostChunkUploadTest.java > 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)