[
https://issues.apache.org/jira/browse/COMPRESS-485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902075#comment-16902075
]
Stefan Bodewig commented on COMPRESS-485:
-----------------------------------------
I finally found an uninterrupted hour of quality time to have a look at it :)
I'm going to merge [~hboutemy]'s PR but have a few comments:
* we do change the signatures for {{ParallelScatterZipCreator#submit}} and
{{#createCallable}}. Most likely nobody has ever used those methods directly,
but still we are breaking backwards compatibility for {{submit}}. There might
be a workaround for that - adding a new {{submitWithANewName}} with the PR's
implementation of {{submit}} and wrap something around the {{Callable}} passed
to the current {{submit}} that would return the thread-local stream. Something
like
{code:java}
public final void submit(final Callable<Object> callable) {
submitThatNewMethodName(new Callable<ScatterZipOutputStream>() {
@Override
public ScatterZipOutputStream call() throws Exception {
callable.call();
return tlScatterStreams.get();
}
});
}
{code}
* I agree with [~tibordigana]'s comments about the thread-unsafety of the way
the changed code iterates the futures, I'll look into his PR separately
* I don't think {{ScatterZipOutputStream.ZipEntryWriter}} and
{{ScatterZipOutputStream#zipEntryWriter}} need to be public, package private
should be good enough (here I'm trying to avoid exposing too many
implementation details as public API).
Once I've merged PR78 I'll close PR77.
> Reproducible Builds: keep entries order when gathering ScatterZipOutputStream
> content in ParallelScatterZipCreator
> ------------------------------------------------------------------------------------------------------------------
>
> Key: COMPRESS-485
> URL: https://issues.apache.org/jira/browse/COMPRESS-485
> Project: Commons Compress
> Issue Type: Improvement
> Components: Archivers
> Affects Versions: 1.18
> Reporter: Hervé Boutemy
> Priority: Major
> Fix For: 1.19
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> currently, zip files created using ParallelScatterZipCreator have random
> order.
> This is causing issues when trying to do Reproducible Builds with Maven
> MNG-6276
> Studying ParallelScatterZipCreator, entries are kept sorted in memory in
> futures list: instead of writing each full scatter in sequence, iterating
> over futures should permit to write each zip entry in original order, without
> changing the API or any performance of the gathering process
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)