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

8315034 : File.mkdirs() occasionally fails to create folders on Windows shared folder #16502

Closed
wants to merge 2 commits into from

Conversation

weibxiao
Copy link
Contributor

@weibxiao weibxiao commented Nov 3, 2023

File.mkdirs() occasionally fails to create folders on Windows shared folders. It turned out that Windows API FindFirstFileW created the error ERROR_NO_MORE_FILES. In some of the cases with a valid file path, this error still returns this error code, which supposedly should not.

Adding this error code into the method of lastErrorReportable in the native code will be handled by JDK.

To test the fix, it needs to run three Java processes to create the folders on a remote file server.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8315034: File.mkdirs() occasionally fails to create folders on Windows shared folder (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16502/head:pull/16502
$ git checkout pull/16502

Update a local copy of the PR:
$ git checkout pull/16502
$ git pull https://git.openjdk.org/jdk.git pull/16502/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16502

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16502.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 3, 2023

👋 Welcome back weibxiao! 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
Copy link

openjdk bot commented Nov 3, 2023

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Nov 3, 2023
* With different the parameters in command line, the test should run successfully without failure. This test
* needs to run three Java processes simultaneously to verify the fix.
* This test requires to run manually and the parent folder as Windows shared folder should be existing already.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no @test tag so this test won't run, not even as a manual test. I would be inclined to just drop this test and add the "noreg-hard" label to the issue.

@@ -138,7 +138,8 @@ lastErrorReportable()
|| (errval == ERROR_BAD_NET_NAME)
|| (errval == ERROR_ACCESS_DENIED)
|| (errval == ERROR_NETWORK_UNREACHABLE)
|| (errval == ERROR_NETWORK_ACCESS_DENIED)) {
|| (errval == ERROR_NETWORK_ACCESS_DENIED)
|| (errval == ERROR_NO_MORE_FILES)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@bplb Is this the same thing as JDK-8234363? Does this also need to be handled in the FindFirstFile usage in WindowsDirectoryStream?

Copy link
Member

Choose a reason for hiding this comment

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

It seems likely. I don't recall having been able to replicate these problems however.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used to duplicate it quite easily on my personal laptop with JDK11 (one laptop with Windows 11, the other with Windows 10). After my laptop system got updated, it was almost impossible to recreate it with my two laptops. To verify this bug, we have to configure exactly the same testing environment as the customer was having.

@weibxiao
Copy link
Contributor Author

Removed the test file and added the label to JBS

@weibxiao weibxiao marked this pull request as ready for review November 30, 2023 14:16
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 30, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 30, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented Nov 30, 2023

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

8315034: File.mkdirs() occasionally fails to create folders on Windows shared folder

Reviewed-by: bpb

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

  • 41daa3b: 8320239: add dynamic switch for JvmtiVTMSTransitionDisabler sync protocol
  • 7c135c3: 8321066: Multiple JFR tests have started failing
  • 8bedb28: 8321119: Disable java/foreign/TestHandshake.java on Zero VMs
  • b1cbf55: 8321018: Parallel: Make some methods in ParCompactionManager private
  • c6a8278: 8321127: ProblemList java/util/stream/GatherersTest.java
  • a3eb664: 8315701: [macos] Regression: KeyEvent has different keycode on different keyboard layouts
  • 6aba6aa: 8320347: Emulate vblendvp[sd] on ECore
  • 6938474: 8320916: jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java failed with "OutOfMemoryError: GC overhead limit exceeded"
  • da09eab: 8319980: [JVMCI] libgraal should reuse Thread instances as C2 does
  • 33b26f7: 8319123: Implement JEP 461: Stream Gatherers (Preview)
  • ... and 502 more: https://git.openjdk.org/jdk/compare/bd22d2381fa3f21b113d5b8ef95fe15cec50b066...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@bplb) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 30, 2023
@weibxiao
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 30, 2023
@openjdk
Copy link

openjdk bot commented Nov 30, 2023

@weibxiao
Your change (at version 5903a48) is now ready to be sponsored by a Committer.

@bplb
Copy link
Member

bplb commented Nov 30, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 30, 2023

Going to push as commit 7ad7005.
Since your change was applied there have been 512 commits pushed to the master branch:

  • 41daa3b: 8320239: add dynamic switch for JvmtiVTMSTransitionDisabler sync protocol
  • 7c135c3: 8321066: Multiple JFR tests have started failing
  • 8bedb28: 8321119: Disable java/foreign/TestHandshake.java on Zero VMs
  • b1cbf55: 8321018: Parallel: Make some methods in ParCompactionManager private
  • c6a8278: 8321127: ProblemList java/util/stream/GatherersTest.java
  • a3eb664: 8315701: [macos] Regression: KeyEvent has different keycode on different keyboard layouts
  • 6aba6aa: 8320347: Emulate vblendvp[sd] on ECore
  • 6938474: 8320916: jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java failed with "OutOfMemoryError: GC overhead limit exceeded"
  • da09eab: 8319980: [JVMCI] libgraal should reuse Thread instances as C2 does
  • 33b26f7: 8319123: Implement JEP 461: Stream Gatherers (Preview)
  • ... and 502 more: https://git.openjdk.org/jdk/compare/bd22d2381fa3f21b113d5b8ef95fe15cec50b066...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 30, 2023
@openjdk openjdk bot closed this Nov 30, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 30, 2023
@openjdk
Copy link

openjdk bot commented Nov 30, 2023

@bplb @weibxiao Pushed as commit 7ad7005.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants