You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Julian Sedding (JIRA)" <ji...@apache.org> on 2017/01/17 11:11:26 UTC

[jira] [Commented] (SLING-6250) Importing packages with large headers fails

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

Julian Sedding commented on SLING-6250:
---------------------------------------

[~teofili] I don't understand how swallowing the exception fixes the issue. Could you please explain why that's a valid fix?

> Importing packages with large headers fails
> -------------------------------------------
>
>                 Key: SLING-6250
>                 URL: https://issues.apache.org/jira/browse/SLING-6250
>             Project: Sling
>          Issue Type: Bug
>          Components: Distribution
>    Affects Versions: Content Distribution Core 0.1.18
>            Reporter: Julian Sedding
>            Assignee: Tommaso Teofili
>         Attachments: SLING-6250-testcase.patch
>
>
> When importing packages with large headers, e.g. packages containing many paths, the following exception is thrown:
> {noformat}
> java.lang.RuntimeException: java.io.IOException: Resetting to invalid mark
> 	at java.io.BufferedInputStream.reset(BufferedInputStream.java:448)
> 	at org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporter.importStream(LocalDistributionPackageImporter.java:122)
> 	at org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterTest.importPackageWithLargeHeader(LocalDistributionPackageImporterTest.java:100)
> {noformat}
> This happens when the header is larger than the default buffer size of the {{BufferedInputStream}} and thus its {{#mark()}} is lost and {{#reset()}} cannot happen anymore.
> I will investigate, whether we can stop relying on marked input streams. This would be desirable, because we cannot know in advance how long the header is.
> cc [~teofili]



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