Skip to content
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

8264821: DirectIOTest fails on a system with large block size #3482

Closed
wants to merge 1 commit into from

Conversation

bplb
Copy link
Member

@bplb bplb commented Apr 14, 2021

Please review this request to clean up a test. The main change is to ensure that the capacity passed to ByteBuffer.allocateDirect() is large enough that when alignedSlice() is called on the new buffer, it creates an aligned buffer which does not have size zero due due to position rounding resulting in out-of-bound values. Other changes in the test are cleanup.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8264821: DirectIOTest fails on a system with large block size

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3482/head:pull/3482
$ git checkout pull/3482

Update a local copy of the PR:
$ git checkout pull/3482
$ git pull https://git.openjdk.java.net/jdk pull/3482/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3482

View PR using the GUI difftool:
$ git pr show -t 3482

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3482.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 14, 2021

👋 Welcome back bpb! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 14, 2021
@openjdk
Copy link

openjdk bot commented Apr 14, 2021

@bplb The following label will be automatically applied to this pull request:

  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the nio nio-dev@openjdk.org label Apr 14, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 14, 2021

Webrevs

@openjdk
Copy link

openjdk bot commented Apr 14, 2021

@bplb 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:

8264821: DirectIOTest fails on a system with large block size

Reviewed-by: chegar

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 9 new commits pushed to the master branch:

  • 75b039a: 8263970: Manual test javax/swing/JTextField/JapaneseReadingAttributes/JapaneseReadingAttributes.java failed
  • f5b2f08: 8257836: Add additional test cases to TestSyncOnValueBasedClassEvent.java
  • 27dd88b: 8262957: (fs) Fail fast in UnixFileStore.isExtendedAttributesEnabled
  • e2106d5: 8265104: CpuLoad and SystemCpuLoad in OperatingSystem MXBean returns -1.0
  • ebbce91: 8264681: Use the blessed modifier order in java.security
  • ea5c55a: 8265103: Remove unnecessary inclusion of oopMap.hpp
  • 26186ec: 8039261: [TEST_BUG]: There is not a minimal security level in Java Preferences and the TestApplet.html is blocked.
  • 283d64f: 8262896: [macos_aarch64] Crash in jni_fast_GetLongField
  • 55d5649: 8263157: [macos]: java.library.path is being set incorrectly

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 14, 2021
@bplb
Copy link
Member Author

bplb commented Apr 14, 2021

/integrate

@openjdk openjdk bot closed this Apr 14, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 14, 2021
@openjdk
Copy link

openjdk bot commented Apr 14, 2021

@bplb Since your change was applied there have been 11 commits pushed to the master branch:

  • 0afcbd4: 8264412: AArch64: CPU description should refer DMI
  • 4661690: 8262883: doccheck: Broken links in java.base
  • 75b039a: 8263970: Manual test javax/swing/JTextField/JapaneseReadingAttributes/JapaneseReadingAttributes.java failed
  • f5b2f08: 8257836: Add additional test cases to TestSyncOnValueBasedClassEvent.java
  • 27dd88b: 8262957: (fs) Fail fast in UnixFileStore.isExtendedAttributesEnabled
  • e2106d5: 8265104: CpuLoad and SystemCpuLoad in OperatingSystem MXBean returns -1.0
  • ebbce91: 8264681: Use the blessed modifier order in java.security
  • ea5c55a: 8265103: Remove unnecessary inclusion of oopMap.hpp
  • 26186ec: 8039261: [TEST_BUG]: There is not a minimal security level in Java Preferences and the TestApplet.html is blocked.
  • 283d64f: 8262896: [macos_aarch64] Crash in jni_fast_GetLongField
  • ... and 1 more: https://git.openjdk.java.net/jdk/compare/e80012ede3564a868abc1705f332bcee942baf48...master

Your commit was automatically rebased without conflicts.

Pushed as commit 7e4cd48.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

FileStore fs = Files.getFileStore(p);
int alignment = (int)fs.getBlockSize();
ByteBuffer dest = ByteBuffer.allocateDirect(SIZE + alignment - 1)
int bs = (int)blockSize;
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a bit clearer to pass the blockSize to the testRead and testWrite methods.

@mlbridge
Copy link

mlbridge bot commented Apr 14, 2021

Mailing list message from Brian Burkhalter on nio-dev:

On Apr 14, 2021, at 8:43 AM, Alan Bateman <alanb at openjdk.java.net<mailto:alanb at openjdk.java.net>> wrote:

test/jdk/java/nio/channels/FileChannel/directio/DirectIOTest.java line 72:

70: private static int testRead(Path p) throws Exception {
71: try (FileChannel fc = FileChannel.open(p, ExtendedOpenOption.DIRECT)) {
72: int bs = (int)blockSize;

It might be a bit clearer to pass the blockSize to the testRead and testWrite methods.

You are probably correct but I already integrated this change.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210414/46417dc0/attachment.htm>

@bplb bplb deleted the DirectIO-LargeBlocks-8264821 branch April 14, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated nio nio-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants