8293792: runtime/Dictionary/ProtectionDomainCacheTest.java fails with FileAlreadyExistsException: /tmp#10266
8293792: runtime/Dictionary/ProtectionDomainCacheTest.java fails with FileAlreadyExistsException: /tmp#10266DamonFool wants to merge 1 commit intoopenjdk:masterfrom
Conversation
… FileAlreadyExistsException: /tmp
|
👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into |
|
@DamonFool The following label will be automatically applied to this pull request:
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. |
|
Hello Jie,
The JarUtils.createJarFile on that line uses: From what I can see in the javadoc of So if it indeed is throwing a |
|
I could reproduce the issue with |
Okay, thanks @jaikiran . |
|
/label add hotspot-runtime |
|
@coleenp |
The specification is that symbolic links are followed by default, with a few exceptions (like delete and move) where it would be wrong to follow links. Files.createDirectories was originally intended to be like mkdir -p. We'd need to check the history but I suspect it is a long standing bug that createAndCheckIsDirectory opts out of following links. |
iklam
left a comment
There was a problem hiding this comment.
The fix looks reasonable to me.
There's a potential error case, if parent is not a directory. However, this should lead to an exception later inside Files.newOutputStream(jarfile), so I think it's OK to not check for this.
|
@DamonFool This change is no longer ready for integration - check the PR body for details. |
AlanBateman
left a comment
There was a problem hiding this comment.
I see Ioi has approved the change but I don't think we should put this workaround into the test library. The issue here is that Files.createDirectories should work like mkdir -p when there are sym links in the tree. Jai is experimenting with a fix to that.
iklam
left a comment
There was a problem hiding this comment.
Withdraw my approval per Alan's comment.
Okay. |
|
Close this one since it would be fixed by @jaikiran in a separate pr. |
Hi all,
runtime/Dictionary/ProtectionDomainCacheTest.java fails on Linux if
/tmpis a symbolic link directory.The root cause is that
JarUtils.createJarFile[1] will throwFileAlreadyExistsExceptionifparentis a symbolic directory.So it seems better to test the existance of
parentbefore creation.Testing:
Thanks.
Best regards,
Jie
[1] https://github.com/openjdk/jdk/blob/master/test/lib/jdk/test/lib/util/JarUtils.java#L72
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10266/head:pull/10266$ git checkout pull/10266Update a local copy of the PR:
$ git checkout pull/10266$ git pull https://git.openjdk.org/jdk pull/10266/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10266View PR using the GUI difftool:
$ git pr show -t 10266Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10266.diff