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

8276661: (fs) UserDefinedFileAttributeView no longer works with long path (win) #6435

Closed

Conversation

bplb
Copy link
Member

@bplb bplb commented Nov 17, 2021

Please consider this change which uses a new method WindowsPath::getPathWithPrefixForWin32Calls.


Progress

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

Issue

  • JDK-8276661: (fs) UserDefinedFileAttributeView no longer works with long path (win)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6435

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

Using diff file

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

@bplb
Copy link
Member Author

bplb commented Nov 17, 2021

The test fails without the proposed implementation change but passes with the change.

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 17, 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 Nov 17, 2021
@openjdk
Copy link

openjdk bot commented Nov 17, 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 Nov 17, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 17, 2021

@bplb
Copy link
Member Author

bplb commented Nov 18, 2021

The test passes locally but has some problem when run in the CI and fails with a message like this:

Exception: java.nio.file.FileSystemException: \\\\localhost\\t$\\testoutput\\test-support\\jtreg_open_test_jdk_java_nio_file_attribute_UserDefinedFileAttributeView_Basic_java\\tmp\\name12001724450276850194\\ea-length-bug17788303373605884510\\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: The network name cannot be found

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Thanks for the updates.

@openjdk
Copy link

openjdk bot commented Nov 19, 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:

8276661: (fs) UserDefinedFileAttributeView no longer works with long path (win)

Reviewed-by: alanb

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

  • 8b042d1: 8257856: Make ClassFileVersionsTest.java robust to JDK version updates
  • ad1ff27: 8277422: tools/jar/JarEntryTime.java fails with modified time mismatch
  • 7c4ef3a: 8277985: G1: Compare max_parallel_refinement_threads to UINT_MAX
  • dc2abc9: 8278080: Add --with-cacerts-src='user cacerts folder' to enable deterministic cacerts generation
  • 8d9cb2e: 8278078: Cannot reference super before supertype constructor has been called
  • 65960f7: 8277753: Long*VectorTests.java fail with "bad AD file" on x86_32 after JDK-8276162
  • 3889af3: 8277906: Incorrect type for IV phi of long counted loops after CCP
  • d2b16c8: 8276126: Dump time class transformation causes heap objects of non-boot classes to be archived
  • 7696897: 8276837: [macos]: Error when signing the additional launcher
  • 3d98ec1: 8273056: java.util.random does not correctly sample exponential or Gaussian distributions
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/51d6d7a36b760b2b2b77269cc06438108a9931a2...master

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 Nov 19, 2021
@bplb
Copy link
Member Author

bplb commented Nov 23, 2021

Without commit 04, java/nio/file/Files/CheckPermissions.java was failing.

@bplb
Copy link
Member Author

bplb commented Nov 23, 2021

All tiers in the CI pass on Windows.

@AlanBateman
Copy link
Contributor

AlanBateman commented Nov 29, 2021

The latest iteration is 5703b01 which adds a pad count to the API exposed by WindowsPath. I think we need to bury that. The previous iteration with getPathForWin32Calls and getPathWithPrefixForWin32Calls was much cleaner. For the discussion it would be useful to know if test failure was due to MAX_LONG_PATH and whether the limit includes the colon and the stream name.

@bplb
Copy link
Member Author

bplb commented Dec 1, 2021

Merged code passes tiers 1-3 tests in the CI.

@AlanBateman
Copy link
Contributor

AlanBateman commented Dec 2, 2021

The latest revision looks good and I think we were lucky that the CheckPermissions test caught the issue.

One suggestion is to invert forceLongPrefix to something like allowShortPath. I think this would make getPathForWin32Calls a bit easier to read because because it avoid two uses of !forceLongPrefix.

@bplb
Copy link
Member Author

bplb commented Dec 2, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Dec 2, 2021

Going to push as commit 15345e3.
Since your change was applied there have been 29 commits pushed to the master branch:

  • 652b5f8: 8276674: Malformed Javadoc inline tags in JDK source
  • e0f1fc7: 8277358: Accelerate CRC32-C
  • 73a9654: 8276806: Use Objects.checkFromIndexSize where possible in java.base
  • 30087cc: 8275342: Change nested classes in java.prefs to static nested classes
  • 669c90e: 8278099: two sun/security/pkcs11/Signature tests failed with AssertionError
  • 4f15be2: 8277965: Enclosing instance optimization affects serialization
  • 8f196a2: 8278037: Clean up PPC32 related code in C1
  • 8b042d1: 8257856: Make ClassFileVersionsTest.java robust to JDK version updates
  • ad1ff27: 8277422: tools/jar/JarEntryTime.java fails with modified time mismatch
  • 7c4ef3a: 8277985: G1: Compare max_parallel_refinement_threads to UINT_MAX
  • ... and 19 more: https://git.openjdk.java.net/jdk/compare/51d6d7a36b760b2b2b77269cc06438108a9931a2...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 2, 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 Dec 2, 2021
@openjdk
Copy link

openjdk bot commented Dec 2, 2021

@bplb Pushed as commit 15345e3.

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

@bplb bplb deleted the UserDefinedFileAttributeView-longpath-8276661 branch Dec 2, 2021
}

// cache the resolved path (except drive relative paths as the working
// directory on removal media devices can change during the lifetime
// of the VM)
if (type != WindowsPathType.DRIVE_RELATIVE) {
if (allowShortPath && type != WindowsPathType.DRIVE_RELATIVE) {
synchronized (this) {
Copy link
Member

@turbanoff turbanoff Dec 3, 2021

Choose a reason for hiding this comment

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

Hm. Why do we need this synchronized here? Seems redundant for me.

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
3 participants