Skip to content

COMPRESS-485 keep zip entries order in parallel zip creation#78

Closed
hboutemy wants to merge 1 commit intoapache:masterfrom
hboutemy:COMPRESS-485
Closed

COMPRESS-485 keep zip entries order in parallel zip creation#78
hboutemy wants to merge 1 commit intoapache:masterfrom
hboutemy:COMPRESS-485

Conversation

@hboutemy
Copy link
Copy Markdown
Member

@hboutemy hboutemy commented May 6, 2019

this will enable Reproducible Builds when creating zip or jar archives

this is another implementation of idea in PR #77

@coveralls
Copy link
Copy Markdown

coveralls commented May 6, 2019

Coverage Status

Coverage decreased (-0.1%) to 86.428% when pulling ee88360 on hboutemy:COMPRESS-485 into e127b13 on apache:master.

@hboutemy hboutemy force-pushed the COMPRESS-485 branch 3 times, most recently from b3a1b0a to dc89094 Compare May 8, 2019 15:29
this will ease Reproducible Builds when creating zip or jar archives

thanks to Arnaud Nauwynck for the great help

synchronized (streams) {
// write zip entries in the order they were added (kept as futures)
for (final Future<ScatterZipOutputStream> future : futures) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop was added. And it is a problem in this synchronized block.
The monitor lock is streams and not futures. They cannot be both in one statement.
Problem: this will cause NPE when the CPU is overloaded. The same issue was fixed in Surefire (see memory model).
Additionally the futures.add() is not synchronized!
One way would be for you to introduce double synchro block.
I would not do it! Instead I would avoid synchronizations of ArrayList and on both. Then I would use modern collections which do not need external synchronizatrions (i.e. Collections.synch...) and this way there would not be any synchronized. Use ConcurrentLinkedDequeue. It is useful when you add to the tail of the queue and do not remove, and if you iterate, because this implementation safely iterates even if you change it : no issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the pr #79

@michael-o
Copy link
Copy Markdown
Member

I am fine with the change, Hervé explained in great detail in the JIRA issue his approach.

@bodewig
Copy link
Copy Markdown
Member

bodewig commented Aug 7, 2019

@Tibor17
Copy link
Copy Markdown
Contributor

Tibor17 commented Aug 11, 2019

@bodewig
As I have seen the history, there is high intensity of commits in master. Do you plan a new release?

@bodewig
Copy link
Copy Markdown
Member

bodewig commented Aug 11, 2019

I have a bunch of issues assigned to the 1.19 milestone in JIRA and intend to cut a new release once all of them are fixed. This doesn't imply they'd be the only issues acceptable, but these are the only ones I can promise I will work on.
Speaking of "promise", there have been several months where I have been more or less absent. This will happen again. Right now I'm determined to get 1.19 out of the door before it happens again.
As usual, more hands are always welcome :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants