-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8303891: Speed up Zip64SizeTest using a small ZIP64 file #12948
Conversation
👋 Welcome back eirbjo! A progress list of the required criteria for merging this PR into |
Webrevs
|
@eirbjo This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@eirbjo This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
…tries in the ZIP file
/open |
@eirbjo This pull request is now open |
Reopening this PR which was closed without review in May 2023. Initially, this PR suggested to use a sparse file when creating the large ZIP file. After consideration, I have found it simpler to instead doctor a small-sized ZIP64-entry with the specific structure required to trigger the regression being tested. I have verified that the test actually fails if |
/issue add 8259866 |
@eirbjo |
|
||
ZipEntry e1 = new ZipEntry("first"); | ||
// Make room for an 8-byte ZIP64 extra field | ||
e1.setExtra(createOpaqueExtra((short) Long.BYTES)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Eirik, I couldn't understand why we first add a opaque extra field first and then update it to be a zip64 extra field. Why do we do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Eirik, I couldn't understand why we first add a opaque extra field first and then update it to be a zip64 extra field. Why do we do this?
ZipEntry.setExtra
processes the byte array argument, looking for Zip64 extended fields which it can extract the size fields from. To prevent this parsing from happening, we temporarily use the unknown
tag.
In this particular case, ZipExtra.setExtra
actually ends up skipping this processing (because isLOC == true
and it has a guard for the block size being >= 16
).
However, I prefer the test to not depend too much on the details of setExtra
Zip64 processing. This trick is used in other tests as well and may be copied over to a test where the conditions are not the same.
I have refactored a bit and added some code comments to help explain the use of the 'unknown' tag.
Do you think this makes sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Eirik, thank you for that detail. Yes, what you note and the updated comment, looks good to me.
…revent ZipEntry.setExtra0 from processing the extra field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the latest updates Eirik.
Overall it is good a few more comment suggestions for extra clarity.
ZipEntry e1 = new ZipEntry("first"); | ||
|
||
// Make an extra field with the correct size for an 8-byte 'uncompressed size' | ||
// Zip64 field. Temporarily use the 'unknown' tag 0x9902 to make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding a reference to the following in the APPNOTE.TXT to make clearer where that value came from
4.6.1 Third party mappings commonly used are:
another suggestion would be to show the CEN here with this change I think would make it easier for someone who is not as familiar with APPNOTE.TXT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CEN structure is already descibed in the method-level documentation. Would you prefer I move it into the code? Not sure I would like to repeat it, and I think perhaps it's better to have the whole structure in once place, instead of splitting it (since the Zip64 extra corresponds to the CEN header fields).
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding a reference to the following in the APPNOTE.TXT to make clearer where that value came from
Added a reference to "Third Party Mappings". (It's not super-important that we chose 'unknown' here, it just seemed a reasonable choice for something ZipEntry cannot see into)
} | ||
} | ||
} | ||
private static void updateCENHeaderToZip64(byte[] zip) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again minor but perhaps articulate that after this call, the extra data will be(obvious to you and I but probably not to others...)
- 00B4 Extra ID Azure Pipelines continuous integration (without running tests, for now) #1 0001 'ZIP64'
- 00B6 Length 0008
- 00B8 Uncompressed Size 0000000000000005
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again minor but perhaps articulate that after this call, the extra data will be(obvious to you and I but probably not to others...)
Added zipdetails
describing the resulting ZIP64 structure to the updateCENHeaderToZip64
method documentation.
@eirbjo This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 115 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These test-only changes look good to me.
/integrate |
Going to push as commit 842b895.
Your commit was automatically rebased without conflicts. |
Please review this PR which suggests we speed up the
Zip64SizeTest
using a small-sized ZIP64 ZIP file specifically created to reproduce the issue being tested.The disk space requirement of this test is known to cause problems in some builds, see JDK-8259866
By using a sparse file, we reduce consumed disk space from 5GB to 266 bytes and also reduce the runtime from ~35 seconds to ~1 seconds on my Macbook Pro.
The PR also fixes the
@summary
tag, which seems to have been copied from an unrelated test.Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/12948/head:pull/12948
$ git checkout pull/12948
Update a local copy of the PR:
$ git checkout pull/12948
$ git pull https://git.openjdk.org/jdk.git pull/12948/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12948
View PR using the GUI difftool:
$ git pr show -t 12948
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12948.diff
Webrev
Link to Webrev Comment