From alanb at openjdk.org Fri Aug 1 12:35:00 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 1 Aug 2025 12:35:00 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments [v4] In-Reply-To: References: Message-ID: <9vgJjBF08ScDCdTq96bI8qdOhE7yoAJoNKj1RiC2UVs=.6558431e-7d89-444b-b4b2-59a05ca8aa60@github.com> On Thu, 31 Jul 2025 16:17:55 GMT, Alan Bateman wrote: >> Brett Okken has updated the pull request incrementally with one additional commit since the last revision: >> >> whitespace > > [JDK-8364345](https://bugs.openjdk.org/browse/JDK-8364345) tracks an intermittent failure with the test where CharBufferAsCharSequenceTest.randomizeRange fails. > @AlanBateman [JDK-8364345](https://bugs.openjdk.org/browse/JDK-8364345) was fixed in [5ec88b8](https://github.com/openjdk/jdk/commit/5ec88b87cf525d5ac19147b28e98f225f9f67deb) > > The problem was when a `CharBuffer` which had already had a random range applied was sliced and then randomized again. Good, it means we can close the other issue once the test update goes in. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26512#issuecomment-3144428710 From duke at openjdk.org Fri Aug 1 13:40:01 2025 From: duke at openjdk.org (Brett Okken) Date: Fri, 1 Aug 2025 13:40:01 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments [v4] In-Reply-To: References: Message-ID: On Tue, 29 Jul 2025 15:49:33 GMT, Alan Bateman wrote: >> Brett Okken has updated the pull request incrementally with one additional commit since the last revision: >> >> whitespace > > test/jdk/java/nio/Buffer/CharBufferAsCharSequenceTest.java line 104: > >> 102: *
  • String - description of the test scenario
  • >> 103: * >> 104: */ > > That helps a bit but I think we need to break up charBufferArguments into simpler/maintainable methods that have clear comments to document the test cases that they generate. Right now it's just way too hard to see what is tested and not tested. @AlanBateman @RogerRiggs any thoughts on just keeping the "random" tests and removing the "static"? As I started breaking the static tests up into simpler methods, they ended up looking like the "random" tests, just with fixed offsets instead of what `randomizeRange` is doing, which did not really seem all that valuable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26512#discussion_r2248015202 From rriggs at openjdk.org Fri Aug 1 14:05:56 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 1 Aug 2025 14:05:56 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments [v4] In-Reply-To: References: Message-ID: On Wed, 30 Jul 2025 18:03:10 GMT, Brett Okken wrote: >> Address code review comments which came in post integration/merge of https://github.com/openjdk/jdk/pull/26282. >> >> Update/clarify test summary tag >> Document the values generated for arguments >> Move the endian-ness qualifier in the test descriptor string to not be first >> Change test method names to more closely match arg names of method under test > > Brett Okken has updated the pull request incrementally with one additional commit since the last revision: > > whitespace I updated the issue title (8364213) to match the current test name; please update the PR description. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26512#issuecomment-3144701811 From rriggs at openjdk.org Fri Aug 1 14:16:55 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 1 Aug 2025 14:16:55 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments [v4] In-Reply-To: References: Message-ID: <-wZ_04zmIGii_Aabj7TMpeICmz0cLBbvqOC0eofKeuI=.202dfa03-0f3c-4445-8051-c1eb74ee8a7e@github.com> On Fri, 1 Aug 2025 13:37:29 GMT, Brett Okken wrote: >> test/jdk/java/nio/Buffer/CharBufferAsCharSequenceTest.java line 104: >> >>> 102: *
  • String - description of the test scenario
  • >>> 103: * >>> 104: */ >> >> That helps a bit but I think we need to break up charBufferArguments into simpler/maintainable methods that have clear comments to document the test cases that they generate. Right now it's just way too hard to see what is tested and not tested. > > @AlanBateman @RogerRiggs any thoughts on just keeping the "random" tests and removing the "static"? > > As I started breaking the static tests up into simpler methods, they ended up looking like the "random" tests, just with fixed offsets instead of what `randomizeRange` is doing, which did not really seem all that valuable. If they duplicate the random tests, then can be removed. Which cases would you remove? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26512#discussion_r2248098512 From duke at openjdk.org Fri Aug 1 15:08:56 2025 From: duke at openjdk.org (Brett Okken) Date: Fri, 1 Aug 2025 15:08:56 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v4] In-Reply-To: <-wZ_04zmIGii_Aabj7TMpeICmz0cLBbvqOC0eofKeuI=.202dfa03-0f3c-4445-8051-c1eb74ee8a7e@github.com> References: <-wZ_04zmIGii_Aabj7TMpeICmz0cLBbvqOC0eofKeuI=.202dfa03-0f3c-4445-8051-c1eb74ee8a7e@github.com> Message-ID: <4bLBYwqOHTgs-zkSj3J-Lsmqugt-xnqQJn-WAoCN5n8=.cd2954d3-0140-4099-b0c5-8eb79ee2f85a@github.com> On Fri, 1 Aug 2025 14:14:47 GMT, Roger Riggs wrote: > Which cases would you remove? All of these: https://github.com/openjdk/jdk/blob/master/test/jdk/java/nio/Buffer/CharBufferAsCharSequenceTest.java#L108-L182 As I walked through documenting what they cover, and then worked on breaking them out into smaller methods, they are just exercising the different types, at different ranges and offsets. I do not see a single scenario the static tests are covering which the dynamic/random tests do not. There are actually more combos covered with the random tests. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26512#discussion_r2248217647 From rriggs at openjdk.org Fri Aug 1 15:20:55 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 1 Aug 2025 15:20:55 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v4] In-Reply-To: <4bLBYwqOHTgs-zkSj3J-Lsmqugt-xnqQJn-WAoCN5n8=.cd2954d3-0140-4099-b0c5-8eb79ee2f85a@github.com> References: <-wZ_04zmIGii_Aabj7TMpeICmz0cLBbvqOC0eofKeuI=.202dfa03-0f3c-4445-8051-c1eb74ee8a7e@github.com> <4bLBYwqOHTgs-zkSj3J-Lsmqugt-xnqQJn-WAoCN5n8=.cd2954d3-0140-4099-b0c5-8eb79ee2f85a@github.com> Message-ID: <40gl3gSIegSMi9AdkQVUViwy4SpxY0Rdun3Ub2J5pQo=.21db223e-0010-4634-8472-461c948564e4@github.com> On Fri, 1 Aug 2025 15:06:41 GMT, Brett Okken wrote: >> If they duplicate the random tests, then can be removed. >> Which cases would you remove? > >> Which cases would you remove? > > All of these: > https://github.com/openjdk/jdk/blob/master/test/jdk/java/nio/Buffer/CharBufferAsCharSequenceTest.java#L108-L182 > > As I walked through documenting what they cover, and then worked on breaking them out into smaller methods, they are just exercising the different types, at different ranges and offsets. I do not see a single scenario the static tests are covering which the dynamic/random tests do not. There are actually more combos covered with the random tests. Looks fine to remove those as duplicates. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26512#discussion_r2248242428 From duke at openjdk.org Fri Aug 1 16:28:11 2025 From: duke at openjdk.org (Brett Okken) Date: Fri, 1 Aug 2025 16:28:11 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v5] In-Reply-To: References: Message-ID: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> > Address code review comments which came in post integration/merge of https://github.com/openjdk/jdk/pull/26282. > > Update/clarify test summary tag > Document the values generated for arguments > Move the endian-ness qualifier in the test descriptor string to not be first > Change test method names to more closely match arg names of method under test Brett Okken has updated the pull request incrementally with one additional commit since the last revision: remove static test cases ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26512/files - new: https://git.openjdk.org/jdk/pull/26512/files/0263f51b..9ecfcb0c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26512&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26512&range=03-04 Stats: 103 lines in 1 file changed: 1 ins; 78 del; 24 mod Patch: https://git.openjdk.org/jdk/pull/26512.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26512/head:pull/26512 PR: https://git.openjdk.org/jdk/pull/26512 From bpb at openjdk.org Fri Aug 1 16:41:56 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 1 Aug 2025 16:41:56 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v5] In-Reply-To: <40gl3gSIegSMi9AdkQVUViwy4SpxY0Rdun3Ub2J5pQo=.21db223e-0010-4634-8472-461c948564e4@github.com> References: <-wZ_04zmIGii_Aabj7TMpeICmz0cLBbvqOC0eofKeuI=.202dfa03-0f3c-4445-8051-c1eb74ee8a7e@github.com> <4bLBYwqOHTgs-zkSj3J-Lsmqugt-xnqQJn-WAoCN5n8=.cd2954d3-0140-4099-b0c5-8eb79ee2f85a@github.com> <40gl3gSIegSMi9AdkQVUViwy4SpxY0Rdun3Ub2J5pQo=.21db223e-0010-4634-8472-461c948564e4@github.com> Message-ID: <0ZC-5Q81Yj5kNCaomgrw7cTSZwdAPxSY8KiviWcQSuo=.90d3810b-0afc-4c97-bb08-db9cde983f0f@github.com> On Fri, 1 Aug 2025 15:18:06 GMT, Roger Riggs wrote: >>> Which cases would you remove? >> >> All of these: >> https://github.com/openjdk/jdk/blob/master/test/jdk/java/nio/Buffer/CharBufferAsCharSequenceTest.java#L108-L182 >> >> As I walked through documenting what they cover, and then worked on breaking them out into smaller methods, they are just exercising the different types, at different ranges and offsets. I do not see a single scenario the static tests are covering which the dynamic/random tests do not. There are actually more combos covered with the random tests. > > Looks fine to remove those as duplicates. > I do not see a single scenario the static tests are covering which the dynamic/random tests do not. There are actually more combos covered with the random tests. I have observed this situation before elsewhere. Although random tests can be irritating and sometimes tricky to get right, I think in the end the coverage is better. And with the `RandomFactory` seed available, the results are reproducible. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26512#discussion_r2248410226 From bpb at openjdk.org Mon Aug 4 21:45:21 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 4 Aug 2025 21:45:21 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed Message-ID: Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. ------------- Commit messages: - 8364277: Add sub-test to existing test - 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed Changes: https://git.openjdk.org/jdk/pull/26631/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364277 Stats: 218 lines in 4 files changed: 206 ins; 1 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From bpb at openjdk.org Mon Aug 4 21:54:03 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 4 Aug 2025 21:54:03 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v5] In-Reply-To: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> References: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> Message-ID: On Fri, 1 Aug 2025 16:28:11 GMT, Brett Okken wrote: >> Address code review comments which came in post integration/merge of https://github.com/openjdk/jdk/pull/26282. >> >> Update/clarify test summary tag >> Document the values generated for arguments >> Move the endian-ness qualifier in the test descriptor string to not be first >> Change test method names to more closely match arg names of method under test > > Brett Okken has updated the pull request incrementally with one additional commit since the last revision: > > remove static test cases Looks all right. ------------- Marked as reviewed by bpb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26512#pullrequestreview-3085864666 From alanb at openjdk.org Tue Aug 5 06:56:10 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 5 Aug 2025 06:56:10 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed In-Reply-To: References: Message-ID: On Mon, 4 Aug 2025 21:38:34 GMT, Brian Burkhalter wrote: > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. On the surface, treating a NTFS directory junction as "other" make sense as they don't fit the file kinds known to the platform. The only reparse points that the JDK can sensibly deal with are symbolic links and Unix domain socket files. My main concern is what might be depending on existing behavior and what inconsistencies will surface if we change this. Would it be possible to enumerate how some of the APIs behave before+after this change? I'm specifically wondering about toRealPath and Files.list/walk behave now and how they will behave with the change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26631#issuecomment-3153735203 From vyazici at openjdk.org Tue Aug 5 08:37:57 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 5 Aug 2025 08:37:57 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character Message-ID: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. ------------- Commit messages: - Add test to verify `CodingErrorAction.REPLACE` for all charsets - Fix incorrect `HKSCS::repl` override Changes: https://git.openjdk.org/jdk/pull/26635/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26635&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364365 Stats: 483 lines in 3 files changed: 472 ins; 9 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/26635.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26635/head:pull/26635 PR: https://git.openjdk.org/jdk/pull/26635 From vyazici at openjdk.org Tue Aug 5 08:38:02 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 5 Aug 2025 08:38:02 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Tue, 5 Aug 2025 08:17:40 GMT, Volkan Yazici wrote: > Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 1: > 1: /* Without the `HKSCS` fix, this test fails for following charsets: Big5-HKSCS x-Big5-HKSCS-2001 x-MS950-HKSCS x-MS950-HKSCS-XP test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 139: > 137: return coderResult.isUnmappable(); > 138: }; > 139: } I'd appreciate it if you can double-check these _"Is the given `char[]` unmappable for a particular encoder?"_ test generators. test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 145: > 143: * different from the given unmappable and the default one. > 144: */ > 145: static byte[] findCustomReplacement(CharsetEncoder encoder, byte[] unmappable) { I'd appreciate it if you can double-check this method. test/jdk/sun/nio/cs/TestEncoderReplaceUTF16.java line 50: > 48: * @build TestEncoderReplaceLatin1 > 49: * @run junit/timeout=10 TestEncoderReplaceUTF16 > 50: * @run junit/timeout=10/othervm -XX:-CompactStrings TestEncoderReplaceUTF16 1. Exercising both compact and inflated layouts for UTF-16. 2. Timeouts ensure that if the `CHARSETS_WITHOUT_UNMAPPABLE` fast-path in `findUnmappableNonLatin1()` becomes ineffective, we will get to know test/jdk/sun/nio/cs/TestEncoderReplaceUTF16.java line 140: > 138: * Finds an {@linkplain CoderResult#isUnmappable() unmappable} non-Latin-1 {@code char[]} for the given encoder. > 139: */ > 140: private static char[] findUnmappableNonLatin1(CharsetEncoder encoder) { I'd appreciate it if you can double-check this method. test/jdk/sun/nio/cs/TestEncoderReplaceUTF16.java line 146: > 144: System.err.println("Character set is known to be absent of unmappable non-Latin-1 characters!"); > 145: return null; > 146: } Without this fast-path, this test take several minutes to complete due to `findUnmappableNonLatin1()` taking ~20 seconds for each character set absent of unmappable Latin-1 characters. test/jdk/sun/nio/cs/TestEncoderReplaceUTF16.java line 184: > 182: } > 183: return sa; > 184: } Used `JavaLangAccess::uncheckedPutCharUTF16` to, given a `char[]`, extract the `byte[]` backing the associated `String`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253526576 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253550878 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253554481 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253532986 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253556174 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253530248 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2253542908 From pminborg at openjdk.org Tue Aug 5 09:08:47 2025 From: pminborg at openjdk.org (Per Minborg) Date: Tue, 5 Aug 2025 09:08:47 GMT Subject: RFR: 8359119: Change Charset to use StableValue [v3] In-Reply-To: References: Message-ID: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> > Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`. > > This PR passes tier1, tier2, and tier3 tests on multiple platforms. Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - Address comments in PR - Merge branch 'master' into stablify-charset - Revert for loop - Revert more - Revert changes - Add stable value functionality ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25727/files - new: https://git.openjdk.org/jdk/pull/25727/files/21a43faa..728b190f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25727&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25727&range=01-02 Stats: 98272 lines in 2418 files changed: 56523 ins; 27371 del; 14378 mod Patch: https://git.openjdk.org/jdk/pull/25727.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25727/head:pull/25727 PR: https://git.openjdk.org/jdk/pull/25727 From pminborg at openjdk.org Tue Aug 5 09:32:05 2025 From: pminborg at openjdk.org (Per Minborg) Date: Tue, 5 Aug 2025 09:32:05 GMT Subject: RFR: 8359119: Change Charset to use StableValue [v2] In-Reply-To: <1HAw1r5SQYTZXX2x4yX6se2gllfH4-o_awAHam6ryKY=.c1da7095-c3ac-4dd0-a9af-d7cc29442a03@github.com> References: <1HAw1r5SQYTZXX2x4yX6se2gllfH4-o_awAHam6ryKY=.c1da7095-c3ac-4dd0-a9af-d7cc29442a03@github.com> Message-ID: On Sun, 20 Jul 2025 22:14:37 GMT, Shaojin Wen wrote: >> Per Minborg has updated the pull request incrementally with three additional commits since the last revision: >> >> - Revert for loop >> - Revert more >> - Revert changes > > After this proposal, the startup will load 9 more classes > > * Java Code > > public class Startup { > public static void main(String[] args) throws Exception { > Thread.sleep(1000); > } > } > > > > ./build/macosx-aarch64-server-release/images/jdk/bin/java -verbose:class Startup > > > By comparing the output before and after this proposal, we can see that 9 more classes are loaded, as follows: > > [info][class,load] java.nio.charset.Charset$2 > [info][class,load] java.lang.StableValue > [info][class,load] java.util.Objects > [info][class,load] jdk.internal.lang.stable.StableSupplier > [info][class,load] jdk.internal.lang.stable.StableValueImpl > [info][class,load] java.nio.charset.Charset$3 > [info][class,load] java.nio.charset.Charset$4 > [info][class,load] java.nio.charset.Charset$5 > [info][class,load] jdk.internal.ref.Cleaner After the most recent updates, here is what I see if I run the `Startup` code by @wenshao (comparing with main line JDK 26): [0.017s][info][class,load] java.lang.ScopedValue source: shared objects file [0.017s][info][class,load] java.lang.ScopedValue$Cache source: shared objects file [0.017s][info][class,load] java.nio.charset.Charset$3 source: shared objects file [0.017s][info][class,load] java.nio.charset.Charset$4 source: shared objects file [0.017s][info][class,load] java.nio.charset.Charset$5 source: shared objects file ------------- PR Comment: https://git.openjdk.org/jdk/pull/25727#issuecomment-3154291506 From alanb at openjdk.org Tue Aug 5 10:14:15 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 5 Aug 2025 10:14:15 GMT Subject: RFR: 8359119: Change Charset to use StableValue [v3] In-Reply-To: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> References: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> Message-ID: On Tue, 5 Aug 2025 09:08:47 GMT, Per Minborg wrote: >> Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`. >> >> This PR passes tier1, tier2, and tier3 tests on multiple platforms. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Address comments in PR > - Merge branch 'master' into stablify-charset > - Revert for loop > - Revert more > - Revert changes > - Add stable value functionality src/java.base/share/classes/java/nio/charset/Charset.java line 387: > 385: } > 386: > 387: private static final ScopedValue IN_LOOKUP = ScopedValue.newInstance(); Thanks for change this to use ScopedValue. Once we change URL and ZipFile to do the same then it should remove the loading of ThreadTracker from startup to offset the loading of other classes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25727#discussion_r2253875925 From bpb at openjdk.org Tue Aug 5 16:07:02 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 5 Aug 2025 16:07:02 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 06:53:24 GMT, Alan Bateman wrote: > Would it be possible to enumerate how some of the APIs behave before+after this change? I will investigate this. Meanwhile I should note that all `jdk_nio` pass in the CI. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26631#issuecomment-3155743847 From bpb at openjdk.org Tue Aug 5 17:48:59 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 5 Aug 2025 17:48:59 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26631/files - new: https://git.openjdk.org/jdk/pull/26631/files/c5794766..cf9eab46 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=00-01 Stats: 12 lines in 3 files changed: 8 ins; 3 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From duke at openjdk.org Tue Aug 5 18:20:04 2025 From: duke at openjdk.org (Johannes =?UTF-8?B?RMO2Ymxlcg==?=) Date: Tue, 5 Aug 2025 18:20:04 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 17:48:59 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test test/lib/jdk/test/lib/util/FileUtils.java line 457: > 455: // Create a directory junction or a symbolic link > 456: if (IS_WINDOWS) { > 457: if (!nativeLibLoaded) { Suggestion: Since this logic to load the FileUtils library is now used twice, why not move it into a helper method which might also be synchronized (if tests are executed in parallel). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255022423 From bpb at openjdk.org Tue Aug 5 18:24:07 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 5 Aug 2025 18:24:07 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 18:17:32 GMT, Johannes D?bler wrote: > Since this logic to load the FileUtils library is now used twice, why not move it into a helper method Sounds like a good idea. I'll investigate. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255029517 From duke at openjdk.org Tue Aug 5 18:45:05 2025 From: duke at openjdk.org (Johannes =?UTF-8?B?RMO2Ymxlcg==?=) Date: Tue, 5 Aug 2025 18:45:05 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 17:48:59 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test test/lib/jdk/test/lib/util/FileUtils.java line 449: > 447: > 448: // Create a link from "junction" to the real path of "target" > 449: public static boolean createDirectoryJunction(String junction, String target) Suggestion: Use Path as type for parameters `junction` and `target` to avoid Path|File->String->Path|File conversions (e.g. the only caller Basic.java already has a Path object for parameter junction, why convert to a String just to recreate a File inside `createDirectoryJunction`). test/lib/jdk/test/lib/util/FileUtils.java line 463: > 461: return createWinDirectoryJunction(junction, target); > 462: } else { > 463: Files.createSymbolicLink(Path.of(junction), Path.of(target)); Suggestion: Junctions are Windows-only, so why not throw a RuntimeException for the non-windows case (and maybe also rename the method to something like `createWindowsDirectoryJunction`) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255068530 PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255040929 From duke at openjdk.org Tue Aug 5 19:31:05 2025 From: duke at openjdk.org (Johannes =?UTF-8?B?RMO2Ymxlcg==?=) Date: Tue, 5 Aug 2025 19:31:05 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 17:48:59 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test test/lib/jdk/test/lib/util/libFileUtils.c line 167: > 165: lpInBuffer = NULL; > 166: > 167: if (result == 0) { Suggestion: Would it be possible to avoid the dreaded goto if ((result != 0) && (CloseHandle(hJunction) != 0)) { return JNI_TRUE; } ...do error handling... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255151112 From bpb at openjdk.org Tue Aug 5 19:31:04 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 5 Aug 2025 19:31:04 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 18:27:13 GMT, Johannes D?bler wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test > > test/lib/jdk/test/lib/util/FileUtils.java line 463: > >> 461: return createWinDirectoryJunction(junction, target); >> 462: } else { >> 463: Files.createSymbolicLink(Path.of(junction), Path.of(target)); > > Suggestion: Junctions are Windows-only, so why not throw a RuntimeException for the non-windows case (and maybe also rename the method to something like `createWindowsDirectoryJunction`) A `RuntimeException` for non-Windows, i.e., Unix, would be a test failure and we can't have that. I think it would be better to convert the test to JUnit 5 and use [@EnabledOnOs(OS.WINDOWS)](https://docs.junit.org/5.2.0/api/org/junit/jupiter/api/condition/EnabledOnOs.html), but that might not be in this PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255155387 From duke at openjdk.org Tue Aug 5 19:44:09 2025 From: duke at openjdk.org (Johannes =?UTF-8?B?RMO2Ymxlcg==?=) Date: Tue, 5 Aug 2025 19:44:09 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 19:28:25 GMT, Brian Burkhalter wrote: >> test/lib/jdk/test/lib/util/FileUtils.java line 463: >> >>> 461: return createWinDirectoryJunction(junction, target); >>> 462: } else { >>> 463: Files.createSymbolicLink(Path.of(junction), Path.of(target)); >> >> Suggestion: Junctions are Windows-only, so why not throw a RuntimeException for the non-windows case (and maybe also rename the method to something like `createWindowsDirectoryJunction`) > > A `RuntimeException` for non-Windows, i.e., Unix, would be a test failure and we can't have that. I think it would be better to convert the test to JUnit 5 and use [@EnabledOnOs(OS.WINDOWS)](https://docs.junit.org/5.2.0/api/org/junit/jupiter/api/condition/EnabledOnOs.html), but that might not be in this PR. Right, but this method is just a helper method not a test method and the caller, e.g. Basic.attributeReadWriteTests|checkAttributesOfJunction should only call it if on Windows. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255177168 From bpb at openjdk.org Tue Aug 5 19:44:10 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 5 Aug 2025 19:44:10 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 19:38:57 GMT, Johannes D?bler wrote: > Right, but this method is just a helper method Okay, I'll look into this and the other suggestions. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255181551 From bpb at openjdk.org Tue Aug 5 21:10:19 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 5 Aug 2025 21:10:19 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 06:53:24 GMT, Alan Bateman wrote: > I'm specifically wondering about toRealPath and Files.list/walk behave now and how they will behave with the change. For a file tree rooted at dir dir: file1* file2* file3* subdir/ dir/subdir: file4* file5* and a directory junction `junction` whose target is `dir`, then for `p = Path.of("junction")`, the results of `p.toRealPath()`, `p.toRealPath(NOFOLLOW_LINKS)`, `Files.list(p)`, and `Files.walk(p, FOLLOW_LINKS)` are identical before and after this change. Only the results of `Files.walk(p)` differ and are as follows: - **before** ```[junction, junction\file1, junction\file2, junction\file3, junction\subdir, junction\subdir\file4, junction\subdir\file5]``` - **after** ```[junction]```. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26631#issuecomment-3156651833 From sherman at openjdk.org Wed Aug 6 00:29:04 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 6 Aug 2025 00:29:04 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Tue, 5 Aug 2025 08:29:21 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 139: > >> 137: return coderResult.isUnmappable(); >> 138: }; >> 139: } > > I'd appreciate it if you can double-check these _"Is the given `char[]` unmappable for a particular encoder?"_ test generators. I might be missing something you're trying to do here, but any reason why we can't just go return c -> !encoder.canEncode(c[0]); as the predicate? I think we are doing 'single char', no surrogates, here, right? or simply do with private static char[] findUnmappable(CharsetEncoder encoder) { for (char c = 0; c < 0xff; c++) { if (!encoder.canEncode(c)) return new char[]{c}; } System.err.println("Could not find an unmappable character!"); return null; } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2255587104 From bpb at openjdk.org Wed Aug 6 01:11:48 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 01:11:48 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v3] In-Reply-To: References: Message-ID: > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364277: Clean up per reviewer comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26631/files - new: https://git.openjdk.org/jdk/pull/26631/files/cf9eab46..ebd6f415 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=01-02 Stats: 34 lines in 3 files changed: 9 ins; 12 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From bpb at openjdk.org Wed Aug 6 01:14:10 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 01:14:10 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 18:41:44 GMT, Johannes D?bler wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8364277: 1) Add and use package scope isDirectoryJunction(); 2) Remove explicit delete of junction from test > > test/lib/jdk/test/lib/util/FileUtils.java line 449: > >> 447: >> 448: // Create a link from "junction" to the real path of "target" >> 449: public static boolean createDirectoryJunction(String junction, String target) > > Suggestion: Use Path as type for parameters `junction` and `target` to avoid Path|File->String->Path|File conversions (e.g. the only caller Basic.java already has a Path object for parameter junction, why convert to a String just to recreate a File inside `createDirectoryJunction`). Done in ebd6f41. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255636088 From bpb at openjdk.org Wed Aug 6 01:14:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 01:14:11 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 18:21:12 GMT, Brian Burkhalter wrote: >> test/lib/jdk/test/lib/util/FileUtils.java line 457: >> >>> 455: // Create a directory junction or a symbolic link >>> 456: if (IS_WINDOWS) { >>> 457: if (!nativeLibLoaded) { >> >> Suggestion: Since this logic to load the FileUtils library is now used twice, why not move it into a helper method which might also be synchronized (if tests are executed in parallel). > >> Since this logic to load the FileUtils library is now used twice, why not move it into a helper method > > Sounds like a good idea. I'll investigate. Done in ebd6f41. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255635632 From bpb at openjdk.org Wed Aug 6 01:14:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 01:14:11 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 19:41:11 GMT, Brian Burkhalter wrote: >> Right, but this method is just a helper method not a test method and the caller, e.g. Basic.attributeReadWriteTests|checkAttributesOfJunction should only call it if on Windows. > >> Right, but this method is just a helper method > > Okay, I'll look into this and the other suggestions. Thanks. Done in ebd6f41. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255635876 From bpb at openjdk.org Wed Aug 6 01:17:20 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 01:17:20 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Tue, 5 Aug 2025 19:26:36 GMT, Johannes D?bler wrote: > Would it be possible to avoid the dreaded goto I expect so, with some careful editing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255638428 From sherman at openjdk.org Wed Aug 6 01:54:14 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 6 Aug 2025 01:54:14 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: <7s4yftGeq4vQ9KGg-Ir2kYeGB14AM5NO2-7cFrMyweA=.985d6857-b33d-4c4a-a901-a0c42f06849d@github.com> On Tue, 5 Aug 2025 08:31:31 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > test/jdk/sun/nio/cs/TestEncoderReplaceUTF16.java line 140: > >> 138: * Finds an {@linkplain CoderResult#isUnmappable() unmappable} non-Latin-1 {@code char[]} for the given encoder. >> 139: */ >> 140: private static char[] findUnmappableNonLatin1(CharsetEncoder encoder) { > > I'd appreciate it if you can double-check this method. I would assume your "double char" actually means the "surrogate pair"? I believe for the first pass of scanning you might want to skip the 'surrogate", as a single dangling surrogate char should trigger a "malformed" error, instead of 'unmappable", if the charset is implemented to handle supplementary character. for (char c = 0xFF; c < 0xFFFF; c++) { if (Character.isSurrogate(c)) continue; if (!encoder.canEncode(c)) return new char[]{c}; } And for the second pass for the 'surrogates", I think we can just pick any non-bmp panel, which should always be translated into a surrogate pair and check if the charset can map/encode it, if not, it's our candidate. for (int i = 0x10000; i < 0x1FFFF; i++) { char[] cc = Character.toChars(i); if (!encoder.canEncode(new String(cc))) return cc; } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2255682596 From sherman at openjdk.org Wed Aug 6 02:20:03 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 6 Aug 2025 02:20:03 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Tue, 5 Aug 2025 08:20:55 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > test/jdk/sun/nio/cs/TestEncoderReplaceUTF16.java line 146: > >> 144: System.err.println("Character set is known to be absent of unmappable non-Latin-1 characters!"); >> 145: return null; >> 146: } > > Without this fast-path, this test take several minutes to complete due to `findUnmappableNonLatin1()` taking ~20 seconds for each character set absent of unmappable Latin-1 characters. we definitely want to exclude 'some' charsets here. yes, all unicode variants probably should be excluded, as they are expected to have a 'mapping' for every unicode character. Additionally, many charsets have an "internal status", meaning they might shift in and shift out its status based on input. See https://www.rfc-editor.org/rfc/rfc1468.html for an example. The encoder might/should add the shift-in/out escape sequence characters on top of the 'replacement', if the replacement character's target sub-charset does not match the 'existing' sub-charset. i would assume this is really out of the scope of this pr though :-) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2255705386 From alanb at openjdk.org Wed Aug 6 06:06:04 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 6 Aug 2025 06:06:04 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v3] In-Reply-To: References: Message-ID: On Wed, 6 Aug 2025 01:11:48 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: Clean up per reviewer comments src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java line 419: > 417: return false; > 418: return ((fileAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0 && > 419: (fileAttrs & FILE_ATTRIBUTE_REPARSE_POINT) != 0); Should this just check if reparseTag has the value IO_REPARSE_TAG_MOUNT_POINT? src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java line 436: > 434: if (isSymbolicLink()) > 435: return false; > 436: return ((fileAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0 && I assume it means that isDirectory no longer needs to use isSymbolicLink as the change means it will return false for all files that are reparse points. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255946387 PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2255949663 From vyazici at openjdk.org Wed Aug 6 10:01:13 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Wed, 6 Aug 2025 10:01:13 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Wed, 6 Aug 2025 02:17:15 GMT, Xueming Shen wrote: > if the replacement character's target sub-charset does not match the 'existing' sub-charset In such a `replacement`, does `CharsetEncoder::isLegalReplacement` still return `true`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2256646879 From vyazici at openjdk.org Wed Aug 6 10:55:02 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Wed, 6 Aug 2025 10:55:02 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: <7s4yftGeq4vQ9KGg-Ir2kYeGB14AM5NO2-7cFrMyweA=.985d6857-b33d-4c4a-a901-a0c42f06849d@github.com> References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> <7s4yftGeq4vQ9KGg-Ir2kYeGB14AM5NO2-7cFrMyweA=.985d6857-b33d-4c4a-a901-a0c42f06849d@github.com> Message-ID: On Wed, 6 Aug 2025 01:51:54 GMT, Xueming Shen wrote: > for (char c = 0xFF; c < 0xFFFF; c++) Doesn't this exclude `0xFFFF`, which is a valid (single-`char`, non-surrogate) BMP character? > ... we can just pick any non-bmp panel ... > ``` > for (int i = 0x10000; i < 0x1FFFF; i++) { ... > ``` Doesn't the non-BMP range rather end with 0x10FFFF? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2256774007 From duke at openjdk.org Wed Aug 6 14:07:22 2025 From: duke at openjdk.org (duke) Date: Wed, 6 Aug 2025 14:07:22 GMT Subject: Withdrawn: 8353923: (fs) Further improve performance of URI -> Path conversion (win) In-Reply-To: References: Message-ID: On Mon, 14 Apr 2025 23:48:18 GMT, Brian Burkhalter wrote: > If the path portion of a `URI` permits, then simply replace all `'\'` with `'/'` instead of completely parsing the path. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/24638 From bpb at openjdk.org Wed Aug 6 17:39:25 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 17:39:25 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v4] In-Reply-To: References: Message-ID: <-brKvHWh2bXqcbEOObF6pI7lZaS6P19CnWXppe4xt84=.4627fb30-7a31-45ed-b04e-a72fb2d2c7d0@github.com> > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364277: 1) improve isDirectory[Junction] per Reviewer comments; 2) restructure native test code to remove the dreaded gotos ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26631/files - new: https://git.openjdk.org/jdk/pull/26631/files/ebd6f415..481bdbcc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=02-03 Stats: 100 lines in 3 files changed: 31 ins; 35 del; 34 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From bpb at openjdk.org Wed Aug 6 17:39:27 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 17:39:27 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v3] In-Reply-To: References: Message-ID: <0C-F2471I42736TtBGckvNQ_C6pv3urTQTLQ-4zcIbk=.8ff4af39-4d0d-41c5-8cb2-b857f9a98d3c@github.com> On Wed, 6 Aug 2025 06:01:07 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8364277: Clean up per reviewer comments > > src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java line 419: > >> 417: return false; >> 418: return ((fileAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0 && >> 419: (fileAttrs & FILE_ATTRIBUTE_REPARSE_POINT) != 0); > > Should this just check if reparseTag has the value IO_REPARSE_TAG_MOUNT_POINT? So changed in 481bdbc. > src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java line 436: > >> 434: if (isSymbolicLink()) >> 435: return false; >> 436: return ((fileAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0 && > > I assume it means that isDirectory no longer needs to use isSymbolicLink as the change means it will return false for all files that are reparse points. So changed in 481bdbc. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2257849276 PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2257849755 From bpb at openjdk.org Wed Aug 6 17:39:28 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 17:39:28 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v2] In-Reply-To: References: Message-ID: On Wed, 6 Aug 2025 01:14:15 GMT, Brian Burkhalter wrote: >> test/lib/jdk/test/lib/util/libFileUtils.c line 167: >> >>> 165: lpInBuffer = NULL; >>> 166: >>> 167: if (result == 0) { >> >> Suggestion: Would it be possible to avoid the dreaded goto >> >> if ((result != 0) && (CloseHandle(hJunction) != 0)) { >> return JNI_TRUE; >> } >> ...do error handling... > >> Would it be possible to avoid the dreaded goto > > I expect so, with some careful editing. `goto`s removed in 481bdbc. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2257848055 From cushon at openjdk.org Wed Aug 6 17:49:26 2025 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Wed, 6 Aug 2025 17:49:26 GMT Subject: RFR: 8344332: (bf) Migrate DirectByteBuffer away from jdk.internal.ref.Cleaner [v7] In-Reply-To: References: Message-ID: On Thu, 17 Jul 2025 15:23:10 GMT, Liam Miller-Cushon wrote: >> Kim Barrett has updated the pull request incrementally with two additional commits since the last revision: >> >> - add @Override for clean() method >> - more commentary for reserveMemory > > src/java.base/share/classes/java/nio/BufferCleaner.java line 203: > >> 201: } >> 202: >> 203: private static final class CleaningThread extends Thread { > > Similar to https://bugs.openjdk.org/browse/JDK-8346124, should this be creating an `InnocuousThread`? I filed https://bugs.openjdk.org/browse/JDK-8364954 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25289#discussion_r2257877328 From sherman at openjdk.org Wed Aug 6 18:04:28 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 6 Aug 2025 18:04:28 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> <7s4yftGeq4vQ9KGg-Ir2kYeGB14AM5NO2-7cFrMyweA=.985d6857-b33d-4c4a-a901-a0c42f06849d@github.com> Message-ID: On Wed, 6 Aug 2025 10:52:00 GMT, Volkan Yazici wrote: >> I would assume your "double char" actually means the "surrogate pair"? >> >> I believe for the first pass of scanning you might want to skip the 'surrogate", as a single dangling surrogate char should trigger a "malformed" error, instead of 'unmappable", if the charset is implemented to handle supplementary character. >> >> for (char c = 0xFF; c < 0xFFFF; c++) { >> if (Character.isSurrogate(c)) >> continue; >> if (!encoder.canEncode(c)) >> return new char[]{c}; >> } >> >> And for the second pass for the 'surrogates", I think we can just pick any non-bmp panel, which should always be translated into a surrogate pair and check if the charset can map/encode it, if not, it's our candidate. >> >> for (int i = 0x10000; i < 0x1FFFF; i++) { >> char[] cc = Character.toChars(i); >> if (!encoder.canEncode(new String(cc))) >> return cc; >> } > >> for (char c = 0xFF; c < 0xFFFF; c++) > > Doesn't this exclude `0xFFFF`, which is a valid (single-`char`, non-surrogate) BMP character? > >> ... we can just pick any non-bmp panel ... >> ``` >> for (int i = 0x10000; i < 0x1FFFF; i++) { ... >> ``` > > Doesn't the non-BMP range rather end with 0x10FFFF? (1) we might want to include 0xffff in first pass (2) we just need to pick any unmappable non-bmp character, i would assume that it should be pretty safe we will find one in the first non-bmp panel that is not encoded by a specific charset. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2257902674 From alanb at openjdk.org Wed Aug 6 18:32:17 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 6 Aug 2025 18:32:17 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v3] In-Reply-To: <0C-F2471I42736TtBGckvNQ_C6pv3urTQTLQ-4zcIbk=.8ff4af39-4d0d-41c5-8cb2-b857f9a98d3c@github.com> References: <0C-F2471I42736TtBGckvNQ_C6pv3urTQTLQ-4zcIbk=.8ff4af39-4d0d-41c5-8cb2-b857f9a98d3c@github.com> Message-ID: <58J2J4rqzVd5wTpMm7cf16SuQBGu0AtSoTRzoOMdyo0=.551b985d-5ef3-4945-85dd-9660103f90a1@github.com> On Wed, 6 Aug 2025 17:34:13 GMT, Brian Burkhalter wrote: >> src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java line 419: >> >>> 417: return false; >>> 418: return ((fileAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0 && >>> 419: (fileAttrs & FILE_ATTRIBUTE_REPARSE_POINT) != 0); >> >> Should this just check if reparseTag has the value IO_REPARSE_TAG_MOUNT_POINT? > > So changed in 481bdbc. Thanks for these updates, the src changes look good now. I haven't looked at the test updates yet, will try to get to this soon. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26631#discussion_r2257960839 From sherman at openjdk.org Wed Aug 6 18:35:16 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 6 Aug 2025 18:35:16 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Wed, 6 Aug 2025 09:58:16 GMT, Volkan Yazici wrote: >> we definitely want to exclude 'some' charsets here. yes, all unicode variants probably should be excluded, as they are expected to have a 'mapping' for every unicode character. Additionally, many charsets have an "internal status", meaning they might shift in and shift out its status based on input. See https://www.rfc-editor.org/rfc/rfc1468.html for an example. The encoder might/should add the shift-in/out escape sequence characters on top of the 'replacement', if the replacement character's target sub-charset does not match the 'existing' sub-charset. i would assume this is really out of the scope of this pr though :-) > >> if the replacement character's target sub-charset does not match the 'existing' sub-charset > > In such a `replacement`, does `CharsetEncoder::isLegalReplacement` still return `true`? it's 'tricky' :-) some charsets have a default initial status, ascii-charset for example, this might trigger false return if the replacement is set without the appropriate shift-in/out esc-seq when target-sub-charset and existing charset are not matched. I'm not confident that all our implementations really handle it correctly :-) it might be interested (not really :-) given these charsets might not be that important these days and it's rare people try to change the default replacement bytes) to do full-scan-check, but again probably is not in-scope of this change. iso2022-jp is one such charset. we attempt to shift-in to the correct sub-charset by keeping the requested mode in **_implReplaceWith_** protected void implReplaceWith(byte[] newReplacement) { /* It's almost impossible to decide which charset they belong to. The best thing we can do here is to "guess" based on the length of newReplacement. */ if (newReplacement.length == 1) { replaceMode = ASCII; } else if (newReplacement.length == 2) { replaceMode = JISX0208_1983; } } then during encoding if (unmappableCharacterAction() == CodingErrorAction.REPLACE && currentMode != replaceMode) { if (dl - dp < 3) return CoderResult.OVERFLOW; if (replaceMode == ASCII) { da[dp++] = (byte)0x1b; da[dp++] = (byte)0x28; da[dp++] = (byte)0x42; } else { da[dp++] = (byte)0x1b; da[dp++] = (byte)0x24; da[dp++] = (byte)0x42; } currentMode = replaceMode; } i believe this might not be really bulletproved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2257966394 From bpb at openjdk.org Wed Aug 6 19:59:53 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 6 Aug 2025 19:59:53 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v5] In-Reply-To: References: Message-ID: <0_fTcRHQzc6aQs3Y_9iO__ygAcdP97VNH3eOVCMi_V8=.26d9cdbf-9fa5-487a-85de-03a15742d202@github.com> > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364277: Ignore restricted warning building BUILD_TEST_LIB_JAR ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26631/files - new: https://git.openjdk.org/jdk/pull/26631/files/481bdbcc..60f5315b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=03-04 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From rriggs at openjdk.org Wed Aug 6 20:18:26 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 6 Aug 2025 20:18:26 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v5] In-Reply-To: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> References: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> Message-ID: On Fri, 1 Aug 2025 16:28:11 GMT, Brett Okken wrote: >> Address code review comments which came in post integration/merge of https://github.com/openjdk/jdk/pull/26282. >> >> Update/clarify test summary tag >> Document the values generated for arguments >> Move the endian-ness qualifier in the test descriptor string to not be first >> Change test method names to more closely match arg names of method under test > > Brett Okken has updated the pull request incrementally with one additional commit since the last revision: > > remove static test cases Looks good, thanks for the test improvements. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26512#pullrequestreview-3094103208 From cushon at openjdk.org Wed Aug 6 23:22:24 2025 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Wed, 6 Aug 2025 23:22:24 GMT Subject: RFR: 8364954: Migrate CleaningThread in BufferCleaner to InnocuousThread Message-ID: This migrates a `Thread` introduced in [JDK-8344332](https://bugs.openjdk.org/browse/JDK-8344332) to use `InnocuousThread`, similar to the changes in [JDK-8345432](https://bugs.openjdk.org/browse/JDK-8345432) to migrate other uses of `Thread` in `java.nio` to `InnocuousThread`. ------------- Commit messages: - 8364954: Migrate CleaningThread in BufferCleaner to InnocuousThread Changes: https://git.openjdk.org/jdk/pull/26665/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26665&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364954 Stats: 6 lines in 1 file changed: 2 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/26665.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26665/head:pull/26665 PR: https://git.openjdk.org/jdk/pull/26665 From bpb at openjdk.org Thu Aug 7 00:45:20 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 7 Aug 2025 00:45:20 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v6] In-Reply-To: References: Message-ID: > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364277: Revert change to BuildTestLib.gmk; move @SuppressWarnings to correct place in FileUtils.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26631/files - new: https://git.openjdk.org/jdk/pull/26631/files/60f5315b..a30e0ce8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=04-05 Stats: 3 lines in 2 files changed: 1 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From duke at openjdk.org Thu Aug 7 13:33:16 2025 From: duke at openjdk.org (duke) Date: Thu, 7 Aug 2025 13:33:16 GMT Subject: RFR: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments [v5] In-Reply-To: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> References: <9_5FaV4QTFnERfhlbO4T1ALBLBLS2XnzfEFIakiMdJM=.18e999fa-2772-4c8b-9249-ee4241141cf4@github.com> Message-ID: On Fri, 1 Aug 2025 16:28:11 GMT, Brett Okken wrote: >> Address code review comments which came in post integration/merge of https://github.com/openjdk/jdk/pull/26282. >> >> Update/clarify test summary tag >> Document the values generated for arguments >> Move the endian-ness qualifier in the test descriptor string to not be first >> Change test method names to more closely match arg names of method under test > > Brett Okken has updated the pull request incrementally with one additional commit since the last revision: > > remove static test cases @bokken Your change (at version 9ecfcb0c9ebb4f76eb58b6a42c7805a7645bb82a) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26512#issuecomment-3164219463 From alanb at openjdk.org Thu Aug 7 13:40:15 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 7 Aug 2025 13:40:15 GMT Subject: RFR: 8364954: Migrate CleaningThread in BufferCleaner to InnocuousThread In-Reply-To: References: Message-ID: On Wed, 6 Aug 2025 23:17:27 GMT, Liam Miller-Cushon wrote: > This migrates a `Thread` introduced in [JDK-8344332](https://bugs.openjdk.org/browse/JDK-8344332) to use `InnocuousThread`, similar to the changes in [JDK-8345432](https://bugs.openjdk.org/browse/JDK-8345432) to migrate other uses of `Thread` in `java.nio` to `InnocuousThread`. Marked as reviewed by alanb (Reviewer). src/java.base/share/classes/java/nio/BufferCleaner.java line 239: > 237: private static final CleanerList cleanerList = new CleanerList(); > 238: private static final ReferenceQueue queue = new ReferenceQueue(); > 239: private static Thread cleaningThread = null; "= null" can be dropped. ------------- PR Review: https://git.openjdk.org/jdk/pull/26665#pullrequestreview-3097205092 PR Review Comment: https://git.openjdk.org/jdk/pull/26665#discussion_r2260365146 From rriggs at openjdk.org Thu Aug 7 14:12:17 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 7 Aug 2025 14:12:17 GMT Subject: RFR: 8364954: Migrate CleaningThread in BufferCleaner to InnocuousThread In-Reply-To: References: Message-ID: On Wed, 6 Aug 2025 23:17:27 GMT, Liam Miller-Cushon wrote: > This migrates a `Thread` introduced in [JDK-8344332](https://bugs.openjdk.org/browse/JDK-8344332) to use `InnocuousThread`, similar to the changes in [JDK-8345432](https://bugs.openjdk.org/browse/JDK-8345432) to migrate other uses of `Thread` in `java.nio` to `InnocuousThread`. Looks good. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26665#pullrequestreview-3097344154 From vyazici at openjdk.org Thu Aug 7 15:07:08 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 7 Aug 2025 15:07:08 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v2] In-Reply-To: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: > Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: - Improve double-`char` unmappable search - Improve single-`char` unmappable search ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26635/files - new: https://git.openjdk.org/jdk/pull/26635/files/4956a5b1..f567f2c8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26635&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26635&range=00-01 Stats: 55 lines in 2 files changed: 3 ins; 37 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/26635.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26635/head:pull/26635 PR: https://git.openjdk.org/jdk/pull/26635 From vyazici at openjdk.org Thu Aug 7 15:07:10 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 7 Aug 2025 15:07:10 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v2] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: <9pnkM5rC_Exr8vfI4RKcvA_0YFj84V9qMPnQLD45qq4=.3899a66f-0418-4117-afae-9fd7fc12f1b8@github.com> On Wed, 6 Aug 2025 00:25:58 GMT, Xueming Shen wrote: >> test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 139: >> >>> 137: return coderResult.isUnmappable(); >>> 138: }; >>> 139: } >> >> I'd appreciate it if you can double-check these _"Is the given `char[]` unmappable for a particular encoder?"_ test generators. > > I might be missing something you're trying to do here, but any reason why we can't just do > > return c -> !encoder.canEncode(c[0]); > > as the predicate? I think we are doing 'single char', no surrogates, here, right? > > or simply go with > > private static char[] findUnmappable(CharsetEncoder encoder) { > for (char c = 0; c <= 0xff; c++) { > if (!encoder.canEncode(c)) > return new char[]{c}; > } > System.err.println("Could not find an unmappable character!"); > return null; > } You're right. Simplified as suggested in ba1e5ff4de6. I wanted to use `{Single,Double}Byte.Encoder` methods deliberately, since those were the ones triggering the failure. Though `CharsetEncoder#canEncode(char)` should do the trick, plus, it is public. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2260610086 From vyazici at openjdk.org Thu Aug 7 15:07:11 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 7 Aug 2025 15:07:11 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v2] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> <7s4yftGeq4vQ9KGg-Ir2kYeGB14AM5NO2-7cFrMyweA=.985d6857-b33d-4c4a-a901-a0c42f06849d@github.com> Message-ID: On Wed, 6 Aug 2025 18:00:00 GMT, Xueming Shen wrote: >>> for (char c = 0xFF; c < 0xFFFF; c++) >> >> Doesn't this exclude `0xFFFF`, which is a valid (single-`char`, non-surrogate) BMP character? >> >>> ... we can just pick any non-bmp panel ... >>> ``` >>> for (int i = 0x10000; i < 0x1FFFF; i++) { ... >>> ``` >> >> Doesn't the non-BMP range rather end with 0x10FFFF? > > (1) we might want to include 0xffff in first pass > (2) we just need to pick any unmappable non-bmp character, i would assume that it should be pretty safe we will find one in the first non-bmp panel that is not encoded by a specific charset. In f567f2c81a3, improved `findUnmappableNonLatin1()` as suggested: Single-`char`: for (int i = 0xFF; i <= 0xFFFF; i++) { char c = (char) i; Double-`char` (i.e., surrogate pair): int[] nonBmpRange = {0x10000, 0x10FFFF}; for (int i = nonBmpRange[0]; i < nonBmpRange[1]; i++) { Note that I took the incentive to use 0x10FFFF as the non-BMP range end ? easier to understand the exhaustive search. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2260609569 From cushon at openjdk.org Thu Aug 7 15:42:57 2025 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Thu, 7 Aug 2025 15:42:57 GMT Subject: RFR: 8364954: (bf) CleaningThread should be InnocuousThread [v2] In-Reply-To: References: Message-ID: On Thu, 7 Aug 2025 13:36:25 GMT, Alan Bateman wrote: >> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove '= null' > > src/java.base/share/classes/java/nio/BufferCleaner.java line 239: > >> 237: private static final CleanerList cleanerList = new CleanerList(); >> 238: private static final ReferenceQueue queue = new ReferenceQueue(); >> 239: private static Thread cleaningThread = null; > > "= null" can be dropped. Done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26665#discussion_r2260711742 From cushon at openjdk.org Thu Aug 7 15:42:56 2025 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Thu, 7 Aug 2025 15:42:56 GMT Subject: RFR: 8364954: (bf) CleaningThread should be InnocuousThread [v2] In-Reply-To: References: Message-ID: > This migrates a `Thread` introduced in [JDK-8344332](https://bugs.openjdk.org/browse/JDK-8344332) to use `InnocuousThread`, similar to the changes in [JDK-8345432](https://bugs.openjdk.org/browse/JDK-8345432) to migrate other uses of `Thread` in `java.nio` to `InnocuousThread`. Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision: Remove '= null' ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26665/files - new: https://git.openjdk.org/jdk/pull/26665/files/89394ce2..d306f87b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26665&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26665&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26665.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26665/head:pull/26665 PR: https://git.openjdk.org/jdk/pull/26665 From bpb at openjdk.org Thu Aug 7 16:13:57 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 7 Aug 2025 16:13:57 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v7] In-Reply-To: References: Message-ID: > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364277: Put IO_REPARSE_TAG_* constants in numerical order ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26631/files - new: https://git.openjdk.org/jdk/pull/26631/files/a30e0ce8..584e04e9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26631&range=05-06 Stats: 2 lines in 1 file changed: 1 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26631/head:pull/26631 PR: https://git.openjdk.org/jdk/pull/26631 From alanb at openjdk.org Thu Aug 7 16:13:57 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 7 Aug 2025 16:13:57 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v6] In-Reply-To: References: Message-ID: On Thu, 7 Aug 2025 00:45:20 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: Revert change to BuildTestLib.gmk; move @SuppressWarnings to correct place in FileUtils.java I don't have any other comments. For the FileUtil test infra then we can probably replace the JNI with FFM codes at some point. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26631#pullrequestreview-3097818857 From bpb at openjdk.org Thu Aug 7 16:13:57 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 7 Aug 2025 16:13:57 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v6] In-Reply-To: References: Message-ID: <6cd79hZcjbhBwWolEeJqexgluykpgQSdX2UFJGi3YOo=.21d62827-aced-4281-aeb5-334e9c31af56@github.com> On Thu, 7 Aug 2025 16:02:08 GMT, Alan Bateman wrote: > For the FileUtil test infra then we can probably replace the JNI with FFM codes at some point. I will put that on the list. I just pushed another minor commit right after you approved. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26631#issuecomment-3164852054 From alanb at openjdk.org Thu Aug 7 16:13:57 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 7 Aug 2025 16:13:57 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v7] In-Reply-To: References: Message-ID: On Thu, 7 Aug 2025 16:10:37 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: Put IO_REPARSE_TAG_* constants in numerical order Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26631#pullrequestreview-3097842635 From bpb at openjdk.org Thu Aug 7 18:38:21 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 7 Aug 2025 18:38:21 GMT Subject: RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed [v7] In-Reply-To: References: Message-ID: On Thu, 7 Aug 2025 16:13:57 GMT, Brian Burkhalter wrote: >> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364277: Put IO_REPARSE_TAG_* constants in numerical order CI tiers 1-3 passed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26631#issuecomment-3165288250 From bpb at openjdk.org Thu Aug 7 18:38:33 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 7 Aug 2025 18:38:33 GMT Subject: Integrated: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed In-Reply-To: References: Message-ID: On Mon, 4 Aug 2025 21:38:34 GMT, Brian Burkhalter wrote: > Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`. This pull request has now been integrated. Changeset: 02e18711 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/02e187119d0ca94d46e631a174c55db4945f3295 Stats: 236 lines in 6 files changed: 211 ins; 8 del; 17 mod 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed Reviewed-by: alanb ------------- PR: https://git.openjdk.org/jdk/pull/26631 From sherman at openjdk.org Thu Aug 7 19:19:16 2025 From: sherman at openjdk.org (Xueming Shen) Date: Thu, 7 Aug 2025 19:19:16 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v2] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Thu, 7 Aug 2025 15:07:08 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Improve double-`char` unmappable search > - Improve single-`char` unmappable search test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 251: > 249: sb.append("%sU+%04X".formatted(i > 0 ? ", " : "", (int) c)); > 250: } > 251: return sb.append(']').toString(); just for fun :-) return IntStream.range(0, cs.length) .mapToObj(i -> String.format("U+%04X", (int) cs[i])) .collect(Collectors.joining(", ", "[", "]")); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2261207568 From duke at openjdk.org Thu Aug 7 19:32:20 2025 From: duke at openjdk.org (Brett Okken) Date: Thu, 7 Aug 2025 19:32:20 GMT Subject: Integrated: 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments In-Reply-To: References: Message-ID: On Mon, 28 Jul 2025 16:43:05 GMT, Brett Okken wrote: > Address code review comments which came in post integration/merge of https://github.com/openjdk/jdk/pull/26282. > > Update/clarify test summary tag > Document the values generated for arguments > Move the endian-ness qualifier in the test descriptor string to not be first > Change test method names to more closely match arg names of method under test This pull request has now been integrated. Changeset: 5116d9e5 Author: Brett Okken Committer: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/5116d9e5fe6b63f12e9ae0eb5283433256872dc1 Stats: 161 lines in 1 file changed: 69 ins; 75 del; 17 mod 8364213: (bf) Improve java/nio/Buffer/CharBufferAsCharSequenceTest test comments 8364345: Test java/nio/Buffer/CharBufferAsCharSequenceTest.java failed Reviewed-by: bpb, rriggs ------------- PR: https://git.openjdk.org/jdk/pull/26512 From rriggs at openjdk.org Thu Aug 7 19:46:25 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 7 Aug 2025 19:46:25 GMT Subject: RFR: 8364954: (bf) CleaningThread should be InnocuousThread [v2] In-Reply-To: References: Message-ID: On Thu, 7 Aug 2025 15:42:56 GMT, Liam Miller-Cushon wrote: >> This migrates a `Thread` introduced in [JDK-8344332](https://bugs.openjdk.org/browse/JDK-8344332) to use `InnocuousThread`, similar to the changes in [JDK-8345432](https://bugs.openjdk.org/browse/JDK-8345432) to migrate other uses of `Thread` in `java.nio` to `InnocuousThread`. > > Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision: > > Remove '= null' Marked as reviewed by rriggs (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26665#pullrequestreview-3098523013 From cushon at openjdk.org Thu Aug 7 19:46:26 2025 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Thu, 7 Aug 2025 19:46:26 GMT Subject: Integrated: 8364954: (bf) CleaningThread should be InnocuousThread In-Reply-To: References: Message-ID: On Wed, 6 Aug 2025 23:17:27 GMT, Liam Miller-Cushon wrote: > This migrates a `Thread` introduced in [JDK-8344332](https://bugs.openjdk.org/browse/JDK-8344332) to use `InnocuousThread`, similar to the changes in [JDK-8345432](https://bugs.openjdk.org/browse/JDK-8345432) to migrate other uses of `Thread` in `java.nio` to `InnocuousThread`. This pull request has now been integrated. Changeset: c0e6ffab Author: Liam Miller-Cushon URL: https://git.openjdk.org/jdk/commit/c0e6ffabc216279068ab887939028ca27f5143f2 Stats: 6 lines in 1 file changed: 2 ins; 0 del; 4 mod 8364954: (bf) CleaningThread should be InnocuousThread Reviewed-by: rriggs, alanb ------------- PR: https://git.openjdk.org/jdk/pull/26665 From vyazici at openjdk.org Fri Aug 8 11:45:04 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 8 Aug 2025 11:45:04 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v3] In-Reply-To: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: > Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Improve pretty-printers ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26635/files - new: https://git.openjdk.org/jdk/pull/26635/files/f567f2c8..f056028a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26635&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26635&range=01-02 Stats: 14 lines in 1 file changed: 2 ins; 6 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/26635.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26635/head:pull/26635 PR: https://git.openjdk.org/jdk/pull/26635 From vyazici at openjdk.org Fri Aug 8 11:45:05 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 8 Aug 2025 11:45:05 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v3] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Thu, 7 Aug 2025 19:17:03 GMT, Xueming Shen wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Improve pretty-printers > > test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 251: > >> 249: sb.append("%sU+%04X".formatted(i > 0 ? ", " : "", (int) c)); >> 250: } >> 251: return sb.append(']').toString(); > > just for fun :-) > > return IntStream.range(0, cs.length) > .mapToObj(i -> String.format("U+%04X", (int) cs[i])) > .collect(Collectors.joining(", ", "[", "]")); Applied suggestion to both `prettyPrint{Bytes,Chars}` in f056028a. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2262713842 From vyazici at openjdk.org Fri Aug 8 13:38:31 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 8 Aug 2025 13:38:31 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v2] In-Reply-To: References: Message-ID: <6LY-pGXEYGVLE2sAYTG8175PvnICXFoHw4velrtLk8E=.dc8a5a32-5c4f-44fa-a281-c5516a22b4bb@github.com> > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Group `String` methods by `doReplace` argument - Merge remote-tracking branch 'upstream/master' into jlaNoRepl - Replace `requireNonNull` with implicit null checks - Merge remote-tracking branch 'upstream/master' into jlaNoRepl - Improve docs of touched methods and add NPE checks - Convert IAE-throwing methods into CCE-throwing ones - Rename `JavaLangAccess::*NoRepl` methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/5f555a68..1fb8582e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=00-01 Stats: 18798 lines in 552 files changed: 11544 ins; 5896 del; 1358 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Fri Aug 8 13:51:10 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 8 Aug 2025 13:51:10 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods In-Reply-To: References: Message-ID: <4vNV2kY5DmMEoWtuq40MzP2BnudJysIwgcjxJpldxBY=.735cf122-f7bb-4d4c-a2ff-7d49cf86d0bf@github.com> On Tue, 29 Jul 2025 13:25:14 GMT, Roger Riggs wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) > > If CCE should have a constructor with a message, it can be added if you have a clear idea how it would be used. Motivated by @RogerRiggs inquiries, and @AlanBateman's below remark, > Another high level comment from a first read is that it feels like there are two forms needed. One form is REPLACE action and doesn't throw. The other is REPORT action and throws CharacterCodingException. grouped `String` methods by `doReplace` argument in 1fb8582e3f9. There are several `String` methods of the following form: private static byte[] encode8859_1(..., boolean doReplace) { // ... if (!doReplace) { throwUnmappable(sp); } // ... } We want to make `doReplace = false` case visible in the function footprint, and this resulted in: private static byte[] encode8859_1(..., boolean doReplace) throws CCE { ... } Though this propagates the checked `CCE` even for `doReplace = true`. To avoid this, I've grouped methods by `doReplace` argument into two: private static byte[] encode8859_1(...) { ... } private static byte[] encode8859_1NoReplacement(...) throws CCE { ... } As a result, 1. `doReplace = true` call-sites invoke `encode8859_1()`, replacement *will* occur, and there is no checked `CCE` thrown 2. `doReplace = false` call-sites invoke `encode8859_1NoReplacement()`, replacement will *not* occur, and `CCE` needs to be handled ------------- PR Comment: https://git.openjdk.org/jdk/pull/26413#issuecomment-3167985180 From liach at openjdk.org Fri Aug 8 17:32:17 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 8 Aug 2025 17:32:17 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v2] In-Reply-To: <6LY-pGXEYGVLE2sAYTG8175PvnICXFoHw4velrtLk8E=.dc8a5a32-5c4f-44fa-a281-c5516a22b4bb@github.com> References: <6LY-pGXEYGVLE2sAYTG8175PvnICXFoHw4velrtLk8E=.dc8a5a32-5c4f-44fa-a281-c5516a22b4bb@github.com> Message-ID: On Fri, 8 Aug 2025 13:38:31 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) > > Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: > > - Group `String` methods by `doReplace` argument > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Replace `requireNonNull` with implicit null checks > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Improve docs of touched methods and add NPE checks > - Convert IAE-throwing methods into CCE-throwing ones > - Rename `JavaLangAccess::*NoRepl` methods src/java.base/share/classes/java/lang/String.java line 855: > 853: int len = val.length >> coder; // assume LATIN1=0/UTF16=1; > 854: int en = scale(len, ce.maxBytesPerChar()); > 855: // Fast-path with `ArrayEncoder` implies replacement. I recommend documenting this on ArrayEncoder instead. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2263641162 From sherman at openjdk.org Fri Aug 8 18:59:12 2025 From: sherman at openjdk.org (Xueming Shen) Date: Fri, 8 Aug 2025 18:59:12 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v3] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: <5G5uoIjwsDxy9oxYpH66W53yh2TFmJDYyqSR57ugD78=.cac5b223-f07e-4c73-afc5-7277ee6a6810@github.com> On Fri, 8 Aug 2025 11:45:04 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve pretty-printers LGTM test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 132: > 130: replacement1[0] = (byte) i; > 131: // Skip the default value, since we're verifying if a custom one works > 132: if (replacement1[0] == replacementD[0]) { nit-pick? if (replacementD.length == 1 && replacement1[0] == replacementD[0]) { ...} ------------- PR Review: https://git.openjdk.org/jdk/pull/26635#pullrequestreview-3101869911 PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2263778167 From sherman at openjdk.org Fri Aug 8 22:15:13 2025 From: sherman at openjdk.org (Xueming Shen) Date: Fri, 8 Aug 2025 22:15:13 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v3] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Fri, 8 Aug 2025 11:45:04 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve pretty-printers lgtm ------------- Marked as reviewed by sherman (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26635#pullrequestreview-3102242861 From bpb at openjdk.org Sat Aug 9 00:16:26 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Sat, 9 Aug 2025 00:16:26 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command Message-ID: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Add `null` check to `AsynchronousChannelGroupImpl.execute`; update existing test. ------------- Commit messages: - 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command Changes: https://git.openjdk.org/jdk/pull/26709/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26709&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364761 Stats: 18 lines in 2 files changed: 15 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26709.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26709/head:pull/26709 PR: https://git.openjdk.org/jdk/pull/26709 From vyazici at openjdk.org Sat Aug 9 07:58:10 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Sat, 9 Aug 2025 07:58:10 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command In-Reply-To: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: On Sat, 9 Aug 2025 00:10:16 GMT, Brian Burkhalter wrote: > Add `null` check to `AsynchronousChannelGroupImpl.execute`; update existing test. LGTM src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java line 303: > 301: @Override > 302: public final void execute(Runnable task) { > 303: Objects.requireNonNull(task, "task"); Do we need to add a `@throws NullPointerException if command is null` to the Javadoc? This is already stated in the Javadoc of the overriden method, but since we explicitly provide Javadoc for the override here... test/jdk/java/nio/channels/AsynchronousChannelGroup/AsExecutor.java line 1: > 1: /* Just a thought: This test can be migrated to JUnit, and `@ParameterizedTest` can be used to provide `AsynchronousChannelGroup`s. This will make it easier to add new `AsynchronousChannelGroup`s and test cases. ------------- Marked as reviewed by vyazici (Committer). PR Review: https://git.openjdk.org/jdk/pull/26709#pullrequestreview-3102834912 PR Review Comment: https://git.openjdk.org/jdk/pull/26709#discussion_r2264587638 PR Review Comment: https://git.openjdk.org/jdk/pull/26709#discussion_r2264586927 From alanb at openjdk.org Sat Aug 9 08:19:10 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 9 Aug 2025 08:19:10 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command In-Reply-To: References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: On Sat, 9 Aug 2025 07:54:47 GMT, Volkan Yazici wrote: >> Add `null` check to `AsynchronousChannelGroupImpl.execute`; update existing test. > > src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java line 303: > >> 301: @Override >> 302: public final void execute(Runnable task) { >> 303: Objects.requireNonNull(task, "task"); > > Do we need to add a `@throws NullPointerException if command is null` to the Javadoc? This is already stated in the Javadoc of the overriden method, but since we explicitly provide Javadoc for the override here... AsynchronousChannelGroup does not implement Executor. The implementation in the JDK does and the bug report is where someone casts it to an Executor. So an off-piste usage that could break of the JDK implementation changes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26709#discussion_r2264596678 From vyazici at openjdk.org Sat Aug 9 08:53:20 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Sat, 9 Aug 2025 08:53:20 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v3] In-Reply-To: <5G5uoIjwsDxy9oxYpH66W53yh2TFmJDYyqSR57ugD78=.cac5b223-f07e-4c73-afc5-7277ee6a6810@github.com> References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> <5G5uoIjwsDxy9oxYpH66W53yh2TFmJDYyqSR57ugD78=.cac5b223-f07e-4c73-afc5-7277ee6a6810@github.com> Message-ID: On Fri, 8 Aug 2025 18:48:43 GMT, Xueming Shen wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Improve pretty-printers > > test/jdk/sun/nio/cs/TestEncoderReplaceLatin1.java line 132: > >> 130: replacement1[0] = (byte) i; >> 131: // Skip the default value, since we're verifying if a custom one works >> 132: if (replacement1[0] == replacementD[0]) { > > nit-pick? > if (replacementD.length == 1 && replacement1[0] == replacementD[0]) { ...} `replacementD` is obtained from `CharsetEncoder#replacement()` and its Javadoc states the following: * @return This encoder's current replacement, * which is never {@code null} and is never empty I had decided to fail when spec. doesn't hold, instead of being lenient against its violation, in particular, since this is a test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26635#discussion_r2264610149 From liach at openjdk.org Sun Aug 10 14:48:13 2025 From: liach at openjdk.org (Chen Liang) Date: Sun, 10 Aug 2025 14:48:13 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v2] In-Reply-To: <6LY-pGXEYGVLE2sAYTG8175PvnICXFoHw4velrtLk8E=.dc8a5a32-5c4f-44fa-a281-c5516a22b4bb@github.com> References: <6LY-pGXEYGVLE2sAYTG8175PvnICXFoHw4velrtLk8E=.dc8a5a32-5c4f-44fa-a281-c5516a22b4bb@github.com> Message-ID: On Fri, 8 Aug 2025 13:38:31 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) > > Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: > > - Group `String` methods by `doReplace` argument > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Replace `requireNonNull` with implicit null checks > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Improve docs of touched methods and add NPE checks > - Convert IAE-throwing methods into CCE-throwing ones > - Rename `JavaLangAccess::*NoRepl` methods Review still in progress, feel free to ping me more more... src/java.base/share/classes/java/lang/String.java line 949: > 947: static byte[] getBytesNoReplacement(String s, Charset cs) throws CharacterCodingException { > 948: Objects.requireNonNull(s, "s"); > 949: Objects.requireNonNull(cs, "cs"); #26600 and subsequent PRs will add variable name reporting, so you can omit the string message to reduce bytecode size. ------------- PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3101693404 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2263645886 From vyazici at openjdk.org Mon Aug 11 07:13:22 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 11 Aug 2025 07:13:22 GMT Subject: Integrated: 8364365: HKSCS encoder does not properly set the replacement character In-Reply-To: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Tue, 5 Aug 2025 08:17:40 GMT, Volkan Yazici wrote: > Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. This pull request has now been integrated. Changeset: c31f4861 Author: Volkan Yazici URL: https://git.openjdk.org/jdk/commit/c31f4861fb6c85c31348ac3e99ccf754d9ee1a60 Stats: 445 lines in 3 files changed: 434 ins; 9 del; 2 mod 8364365: HKSCS encoder does not properly set the replacement character Reviewed-by: sherman ------------- PR: https://git.openjdk.org/jdk/pull/26635 From vyazici at openjdk.org Mon Aug 11 07:13:21 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 11 Aug 2025 07:13:21 GMT Subject: RFR: 8364365: HKSCS encoder does not properly set the replacement character [v3] In-Reply-To: References: <3PIGaLpFxVwtChhNZPyo0Xi-ndm0_yWMz6aRvTtY0vs=.8eb2a779-3f94-482d-a6df-8754da1cb9dd@github.com> Message-ID: On Fri, 8 Aug 2025 11:45:04 GMT, Volkan Yazici wrote: >> Fix `HKSCS` encoder to correctly set the replacement character, and add tests to verify the `CodingErrorAction.REPLACE` behavior of all available encoders. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve pretty-printers Internally verified `tier1,2,3` runs successfully complete. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26635#issuecomment-3173510451 From bpb at openjdk.org Mon Aug 11 15:36:16 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 11 Aug 2025 15:36:16 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command In-Reply-To: References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: On Sat, 9 Aug 2025 08:16:28 GMT, Alan Bateman wrote: > So an off-piste usage that would break if the JDK implementation changes. Hyrum's law redux. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26709#discussion_r2267145746 From bpb at openjdk.org Mon Aug 11 16:19:57 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 11 Aug 2025 16:19:57 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command [v2] In-Reply-To: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: > Add `null` check to `AsynchronousChannelGroupImpl.execute`; update existing test. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8364761: Convert test to JUnit 5 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26709/files - new: https://git.openjdk.org/jdk/pull/26709/files/5f1ddc6b..d5d9665f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26709&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26709&range=00-01 Stats: 59 lines in 1 file changed: 21 ins; 8 del; 30 mod Patch: https://git.openjdk.org/jdk/pull/26709.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26709/head:pull/26709 PR: https://git.openjdk.org/jdk/pull/26709 From bpb at openjdk.org Mon Aug 11 16:19:58 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 11 Aug 2025 16:19:58 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command [v2] In-Reply-To: References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: On Sat, 9 Aug 2025 07:51:44 GMT, Volkan Yazici wrote: > This test can be migrated to JUnit [...]. So changed in d5d9665. While the test is cleaner now, I have to note that while testing this before creating the PR, it was actually easier to use the test outside of jtreg completely as it is quite simple and required no framework. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26709#discussion_r2267305355 From alanb at openjdk.org Mon Aug 11 17:31:16 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 11 Aug 2025 17:31:16 GMT Subject: RFR: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command [v2] In-Reply-To: References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: On Mon, 11 Aug 2025 16:19:57 GMT, Brian Burkhalter wrote: >> Add `null` check to `AsynchronousChannelGroupImpl.execute`; update existing test. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8364761: Convert test to JUnit 5 Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26709#pullrequestreview-3106956516 From bpb at openjdk.org Mon Aug 11 18:53:19 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 11 Aug 2025 18:53:19 GMT Subject: Integrated: 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command In-Reply-To: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> References: <4y55oF0k8jfKkTPnFY182SK5aMdAmfqsDjgbcL8k4t8=.7dd9817d-bf54-465e-9f57-836fdda4c687@github.com> Message-ID: On Sat, 9 Aug 2025 00:10:16 GMT, Brian Burkhalter wrote: > Add `null` check to `AsynchronousChannelGroupImpl.execute`; update existing test. This pull request has now been integrated. Changeset: 8cd79752 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/8cd79752c6426780c6772eafe296aa5b713b2b64 Stats: 59 lines in 2 files changed: 31 ins; 3 del; 25 mod 8364761: (aio) AsynchronousChannelGroup.execute doesn't check null command Reviewed-by: alanb, vyazici ------------- PR: https://git.openjdk.org/jdk/pull/26709 From bpb at openjdk.org Mon Aug 11 19:06:29 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 11 Aug 2025 19:06:29 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v4] In-Reply-To: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: > Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8361495: Remove commented out code and low value print statement ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26435/files - new: https://git.openjdk.org/jdk/pull/26435/files/899f28cd..a39b2f1b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26435&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26435&range=02-03 Stats: 30 lines in 1 file changed: 0 ins; 30 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26435.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26435/head:pull/26435 PR: https://git.openjdk.org/jdk/pull/26435 From bpb at openjdk.org Tue Aug 12 01:22:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 12 Aug 2025 01:22:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links Message-ID: This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. ------------- Commit messages: - 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links Changes: https://git.openjdk.org/jdk/pull/26736/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8154364 Stats: 593 lines in 4 files changed: 533 ins; 24 del; 36 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Tue Aug 12 01:22:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 12 Aug 2025 01:22:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links In-Reply-To: References: Message-ID: <7LAN8mBSwnl5YJ6Y6r871h2pbz01pdbnj77FGGb0iqg=.2f955105-6065-4e44-8428-6c52212536ea@github.com> On Tue, 12 Aug 2025 01:15:35 GMT, Brian Burkhalter wrote: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. In the current implementation, files are considered to be the same only if their (possibly unnormalized) path strings are equal or, when following links, they represent two existing files that have the same file key. In the proposed implementation, the comparison is extended to deem two files equal if their paths when not following links both exist and have a link in common, or if neither file exists but their normalized path strings are equal. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26736#issuecomment-3177380315 From duke at openjdk.org Tue Aug 12 03:09:22 2025 From: duke at openjdk.org (jwilliams990) Date: Tue, 12 Aug 2025 03:09:22 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Mon, 16 Jun 2025 09:44:13 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to enhance the implementation of `ServerSocket` and `ServerSocketChannel` to allow for `backlog` values to be greater than 200 on Windows? This addresses https://bugs.openjdk.org/browse/JDK-8330940. >> >> As noted in that enhancement request, right now on Windows, if the backlog is specified to be more than 200, then Windows caps it to a platform internal `SOMAXCONN`. As noted in the documentation here https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-listen applications can increase that limit by using the `SOMAXCONN_HINT` macro. That macro then adjusts the value to be between 200 and 65535, thus allowing for a higher backlog of connections. >> >> The commit in this PR uses this macro when the specified backlog is 200 or more. A new jtreg test has been introduced to verify this change. This test and other existing tests in tier1, tier2 and tier3 continue to pass. >> >> A similar restriction on the backlog value applies in Linux too https://github.com/torvalds/linux/blob/master/Documentation/networking/ip-sysctl.rst#tcp-variables. But from what I can see, unlike Windows, it cannot be adjusted when calling `listen()`. > > Jaikiran Pai has updated the pull request incrementally with four additional commits since the last revision: > > - include a test for AsynchronousServerSocketChannel > - System.err instead of System.out > - trim down code comment > - > 200 instead of >= 200 Hi, Which version of OpenJDK is this change available in? I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3177373009 From jpai at openjdk.org Tue Aug 12 03:52:18 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 12 Aug 2025 03:52:18 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 01:13:57 GMT, jwilliams990 wrote: >> Jaikiran Pai has updated the pull request incrementally with four additional commits since the last revision: >> >> - include a test for AsynchronousServerSocketChannel >> - System.err instead of System.out >> - trim down code comment >> - > 200 instead of >= 200 > > Hi, Which version of OpenJDK is this change available in? I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). Hello @jwilliams990 > Hi, Which version of OpenJDK is this change available in? This change is currently in the unreleased Java 26 version. It's only available in 26 early access builds https://jdk.java.net/26/ or one has to manually build this JDK repo to use this feature. > I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). Linux too has a limit on the number of backlog connections. I don't know the details of the issue you are running into but it could be unrelated to trying to use a backlog value greater than 200 on Windows, when creating a `ServerSocket`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3177598778 From duke at openjdk.org Tue Aug 12 03:59:24 2025 From: duke at openjdk.org (jwilliams990) Date: Tue, 12 Aug 2025 03:59:24 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 03:49:10 GMT, Jaikiran Pai wrote: >> Hi, Which version of OpenJDK is this change available in? I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). > > Hello @jwilliams990 > >> Hi, Which version of OpenJDK is this change available in? > > This change is currently in the unreleased Java 26 version. It's only available in 26 early access builds https://jdk.java.net/26/ or one has to manually build this JDK repo to use this feature. > >> I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). > > Linux too has a limit on the number of backlog connections. I don't know the details of the issue you are running into but it could be unrelated to trying to use a backlog value greater than 200 on Windows, when creating a `ServerSocket`. Hi @jaikiran, Thanks for your response. Any chance this could be included in Java 21 LTS in the future? The default TCP backlog in Windows is 200. Linux has a default of 4096. The issue i am seeing is when running Apache Tomcat on Windows vs. Linux, Windows shows a very high percentage of connection refused errors vs. Linux. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3177608798 From jpai at openjdk.org Tue Aug 12 04:27:16 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 12 Aug 2025 04:27:16 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 03:49:10 GMT, Jaikiran Pai wrote: >> Hi, Which version of OpenJDK is this change available in? I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). > > Hello @jwilliams990 > >> Hi, Which version of OpenJDK is this change available in? > > This change is currently in the unreleased Java 26 version. It's only available in 26 early access builds https://jdk.java.net/26/ or one has to manually build this JDK repo to use this feature. > >> I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). > > Linux too has a limit on the number of backlog connections. I don't know the details of the issue you are running into but it could be unrelated to trying to use a backlog value greater than 200 on Windows, when creating a `ServerSocket`. > Hi @jaikiran, Thanks for your response. Any chance this could be included in Java 21 LTS in the future? Backports to OpenJDK are managed by a separate "jdk-updates" project https://openjdk.org/projects/jdk-updates/. Members of that project decide which changes should be backported (and when). For this specific change, Java 26 release isn't scheduled for this year. Once it is released and after that version sees usage in real world applications, only then enhancements like these are usually considered for backports. So it's too early to say if/when this change will be backported. In the meantime, what would be good is if you suspect that the backlog limit is indeed causing this issue on your setup, you could try to use the 26 early access build which is available here https://jdk.java.net/26/ and see if that helps you get past this issue. Are you creating a ServerSocket (or some other construct?) with some explicit value for backlog that is greater than 200? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3177649481 From duke at openjdk.org Tue Aug 12 04:33:16 2025 From: duke at openjdk.org (jwilliams990) Date: Tue, 12 Aug 2025 04:33:16 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 04:24:41 GMT, Jaikiran Pai wrote: >> Hello @jwilliams990 >> >>> Hi, Which version of OpenJDK is this change available in? >> >> This change is currently in the unreleased Java 26 version. It's only available in 26 early access builds https://jdk.java.net/26/ or one has to manually build this JDK repo to use this feature. >> >>> I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). >> >> Linux too has a limit on the number of backlog connections. I don't know the details of the issue you are running into but it could be unrelated to trying to use a backlog value greater than 200 on Windows, when creating a `ServerSocket`. > >> Hi @jaikiran, Thanks for your response. Any chance this could be included in Java 21 LTS in the future? > > Backports to OpenJDK are managed by a separate "jdk-updates" project https://openjdk.org/projects/jdk-updates/. Members of that project decide which changes should be backported (and when). > > For this specific change, Java 26 release isn't scheduled for this year. Once it is released and after that version sees usage in real world applications, only then enhancements like these are usually considered for backports. So it's too early to say if/when this change will be backported. > > In the meantime, what would be good is if you suspect that the backlog limit is indeed causing this issue on your setup, you could try to use the 26 early access build which is available here https://jdk.java.net/26/ and see if that helps you get past this issue. Are you creating a ServerSocket (or some other construct?) with some explicit value for backlog that is greater than 200? Hi @jaikiran, I am running Apache Tomcat on Java. Tomcat has an acceptCount set to a large number (greater than 200). I believe Tomcat creates a ServerSocket with the configured acceptCount, and I suspect that it is not effective on Windows for the reasons mentioned above in this trail. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3177657942 From jpai at openjdk.org Tue Aug 12 04:45:16 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 12 Aug 2025 04:45:16 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 04:24:41 GMT, Jaikiran Pai wrote: >> Hello @jwilliams990 >> >>> Hi, Which version of OpenJDK is this change available in? >> >> This change is currently in the unreleased Java 26 version. It's only available in 26 early access builds https://jdk.java.net/26/ or one has to manually build this JDK repo to use this feature. >> >>> I am running into a situation where Java on Windows drops TCP/HTTP connections, but i don't have this issue on Linux (I have tested with JDK 21.0.8+9). >> >> Linux too has a limit on the number of backlog connections. I don't know the details of the issue you are running into but it could be unrelated to trying to use a backlog value greater than 200 on Windows, when creating a `ServerSocket`. > >> Hi @jaikiran, Thanks for your response. Any chance this could be included in Java 21 LTS in the future? > > Backports to OpenJDK are managed by a separate "jdk-updates" project https://openjdk.org/projects/jdk-updates/. Members of that project decide which changes should be backported (and when). > > For this specific change, Java 26 release isn't scheduled for this year. Once it is released and after that version sees usage in real world applications, only then enhancements like these are usually considered for backports. So it's too early to say if/when this change will be backported. > > In the meantime, what would be good is if you suspect that the backlog limit is indeed causing this issue on your setup, you could try to use the 26 early access build which is available here https://jdk.java.net/26/ and see if that helps you get past this issue. Are you creating a ServerSocket (or some other construct?) with some explicit value for backlog that is greater than 200? > Hi @jaikiran, I am running Apache Tomcat on Java. Tomcat has an acceptCount set to a large number (greater than 200). I believe Tomcat creates a ServerSocket with the configured acceptCount, and I suspect that it is not effective on Windows for the reasons mentioned above in this trail. Thank you for that detail, that's useful to know. Based on what you note and what's documented of that Connector attribute in Tomcat docs - https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Attributes_Standard%20Implementation_acceptCount, I think what you are suggesting is correct - the backlog might be playing a role here. If you get a chance to try this with Java 26 early access build, that would be a good experiment to verify that this change does indeed help this use case (I'll be curious to hear how that test goes). ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3177673220 From alanb at openjdk.org Tue Aug 12 06:45:12 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 12 Aug 2025 06:45:12 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 01:15:35 GMT, Brian Burkhalter wrote: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 429: > 427: > 428: // neither exists, compare normalized paths without filesystem access > 429: return obj1.normalize().equals(obj2.normalize()); normalize is to deal with user input, I don't think we should be using it here. (I will try to add review the changes soon but I'm concerned that this will require spec changes). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2268759925 From dclarke at openjdk.org Tue Aug 12 11:16:13 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Tue, 12 Aug 2025 11:16:13 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs In-Reply-To: References: Message-ID: <_KCC0Md1R2Xpvl05BZ0dDYA39hwnoIrW3mzYf8qBvq4=.daef31b0-2157-4b6f-b827-fe333f1f0fc9@github.com> On Sat, 26 Jul 2025 07:46:25 GMT, ExE Boss wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > src/java.base/macosx/classes/sun/nio/ch/KQueuePoller.java line 44: > >> 42: >> 43: KQueuePoller(boolean subPoller, boolean read) throws IOException { >> 44: this.kqfd = kqueue_h.kqueue(); > > Note?that the?old?implementation of?`KQueue.create()` had?a?check for?negative `kqfd`: Sorry for the delay in getting back to this, thanks for the comment though! I'll update the PR to include that again ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2269512920 From dclarke at openjdk.org Tue Aug 12 11:20:12 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Tue, 12 Aug 2025 11:20:12 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs In-Reply-To: References: Message-ID: On Thu, 31 Jul 2025 12:15:32 GMT, Maurizio Cimadamore wrote: >> IMHO the more honest approach is to move these constants closer to the _h generated files that use them, as that's the way jextract intends them to be used. > > (Also, the latest version of jextract uses `Linker.canonicalLayouts` to derive these constants, which might be more robust longer term) I can update FFMUtils so that all the different pointers user `Liner.canonicalLayouts`, As for the other point, I think you're right that the shared FFMUtils won't work though I think it's a bit of a shame because of the number of similar duplicate lines. I can move it back to using different ones for each platform in the next commit ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2269522249 From vyazici at openjdk.org Tue Aug 12 12:11:07 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 12:11:07 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v3] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: - Simplify added null checks - Avoid code duplication by sprinkling some generics magic ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/1fb8582e..f536a341 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=01-02 Stats: 325 lines in 1 file changed: 77 ins; 213 del; 35 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Tue Aug 12 12:11:11 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 12:11:11 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v3] In-Reply-To: <13urR68f8U8oqjrcaX1BtKI-EtD41ySuYt-oz333PdA=.c97d8293-2fbe-415d-983d-92b7e1c9d175@github.com> References: <13urR68f8U8oqjrcaX1BtKI-EtD41ySuYt-oz333PdA=.c97d8293-2fbe-415d-983d-92b7e1c9d175@github.com> Message-ID: On Mon, 28 Jul 2025 22:34:08 GMT, Roger Riggs wrote: >> Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: >> >> - Simplify added null checks >> - Avoid code duplication by sprinkling some generics magic > > src/java.base/share/classes/java/lang/String.java line 571: > >> 569: } >> 570: >> 571: private static String utf8ThrowingIae(byte[] bytes, int offset, int length) { > > Iae should be all-caps. `IAE` This change has disappeared ? the remark is not applicable anymore. > src/java.base/share/classes/java/lang/String.java line 579: > >> 577: } >> 578: >> 579: private static IllegalArgumentException cce2iae(CharacterCodingException cce) { > > More readable would be "cceToIAE" > But this whole construct is suspect because of the contortions needed. This change has disappeared ? the remark is not applicable anymore. > src/java.base/share/classes/java/lang/String.java line 1289: > >> 1287: } >> 1288: >> 1289: private static void throwMalformed(byte[] val) throws MalformedInputException { > > It is unnecessary to add add @throws of RuntimeExceptions, conventionally they are omitted as clutter and any RuntimeException can be thrown at any time. `MalformedInputException` is a checked exception, I think there has been some sort of confusion here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269623466 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269623313 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269621563 From vyazici at openjdk.org Tue Aug 12 12:11:15 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 12:11:15 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v2] In-Reply-To: References: <6LY-pGXEYGVLE2sAYTG8175PvnICXFoHw4velrtLk8E=.dc8a5a32-5c4f-44fa-a281-c5516a22b4bb@github.com> Message-ID: On Fri, 8 Aug 2025 17:29:34 GMT, Chen Liang wrote: >> Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: >> >> - Group `String` methods by `doReplace` argument >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Replace `requireNonNull` with implicit null checks >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Improve docs of touched methods and add NPE checks >> - Convert IAE-throwing methods into CCE-throwing ones >> - Rename `JavaLangAccess::*NoRepl` methods > > src/java.base/share/classes/java/lang/String.java line 855: > >> 853: int len = val.length >> coder; // assume LATIN1=0/UTF16=1; >> 854: int en = scale(len, ce.maxBytesPerChar()); >> 855: // Fast-path with `ArrayEncoder` implies replacement. > > I recommend documenting this on ArrayEncoder instead. This already happens to be the case: /* * FastPath char[]/byte[] -> byte[] encoder, REPLACE on malformed input or * unmappable input. */ public interface ArrayEncoder { ... } > src/java.base/share/classes/java/lang/String.java line 949: > >> 947: static byte[] getBytesNoReplacement(String s, Charset cs) throws CharacterCodingException { >> 948: Objects.requireNonNull(s, "s"); >> 949: Objects.requireNonNull(cs, "cs"); > > #26600 and subsequent PRs will add variable name reporting, so you can omit the string message to reduce bytecode size. Great news! :star_struck: Simplified as requested in f536a341901. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269618475 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269613108 From vyazici at openjdk.org Tue Aug 12 12:11:17 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 12:11:17 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v3] In-Reply-To: References: Message-ID: On Tue, 29 Jul 2025 14:22:56 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/lang/String.java line 1262: >> >>> 1260: MalformedInputException mie = new MalformedInputException(nb); >>> 1261: String msg = "malformed input off : " + off + ", length : " + nb; >>> 1262: mie.initCause(new IllegalArgumentException(msg)); >> >> Earlier `throw(Malformed|Unmappable)` methods were throwing `IAE` containing _extra diagnostics information_ and wrapping a `CCE` as a cause. After switching methods to throw `CCE`, which doesn't have a ctor accepting a `String` message, to retain this extra diagnostics information, I've added swapped their causal chain placement, and wrapped `IAE` with a `CCE` this time. >> >> This played well with `CCE`-throwing methods, yet there are other `public` methods which did not have `throws CCE` in their footprint. For backward compatibility, in those spots, I've used `cce2iae` to obtain, again, a `IAE` wrapping the `CCE`, which matched the old behavior. > > Introducing CCE (an IOException) into more places in string handling is going in the wrong direction. > As declared exceptions, they have to be caught and handled or re-thrown. That makes the source more complex and harder to maintain, as seen in the cce2iae mechanism. > The prior use of IAE encapsulating a CCE as needed is simpler and more consistent with other Runtime exception handling in most of the String class. Since the need for `cce2iae` is disapperaed, I'm resolving this conversation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269607697 From vyazici at openjdk.org Tue Aug 12 12:11:20 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 12:11:20 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v3] In-Reply-To: References: Message-ID: On Mon, 21 Jul 2025 13:00:03 GMT, Chen Liang wrote: > The docs should mention these two details: > > 1. This method does not replace upon malformed data but fails > 2. This method does not copy the byte array for validation (can add to the warning) @liach, I presume you want more than the following two (existing) comment blocks addressing these concerns: * WARNING: The caller of this method shall relinquish and transfer the * ownership of the byte array to the callee, since the latter will not * make a copy. ... * @throws CharacterCodingException for malformed or unmappable bytes If so, mind elaborating on your suggested enhancements, please? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2269632642 From alanb at openjdk.org Tue Aug 12 15:09:21 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 12 Aug 2025 15:09:21 GMT Subject: RFR: 8361209: (bf) Use CharSequence::getChars for StringCharBuffer bulk get methods [v5] In-Reply-To: References: Message-ID: On Wed, 16 Jul 2025 23:23:30 GMT, Brian Burkhalter wrote: >> For `CharBuffer`s created from a `CharSequence`, use `CharSequence.getChars` to perform bulk gets instead of successively copying single characters. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8361209: Fix assertion added in previous commit Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26251#pullrequestreview-3111294961 From duke at openjdk.org Tue Aug 12 15:29:22 2025 From: duke at openjdk.org (jwilliams990) Date: Tue, 12 Aug 2025 15:29:22 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: <_AytxIFrh0G0z7OHW1VfdBLoSvh6N-38vamSjR-GJRM=.7bbebcae-28a0-4caf-9e22-e0d7ba2b443b@github.com> On Tue, 12 Aug 2025 04:41:51 GMT, Jaikiran Pai wrote: >>> Hi @jaikiran, Thanks for your response. Any chance this could be included in Java 21 LTS in the future? >> >> Backports to OpenJDK are managed by a separate "jdk-updates" project https://openjdk.org/projects/jdk-updates/. Members of that project decide which changes should be backported (and when). >> >> For this specific change, Java 26 release isn't scheduled for this year. Once it is released and after that version sees usage in real world applications, only then enhancements like these are usually considered for backports. So it's too early to say if/when this change will be backported. >> >> In the meantime, what would be good is if you suspect that the backlog limit is indeed causing this issue on your setup, you could try to use the 26 early access build which is available here https://jdk.java.net/26/ and see if that helps you get past this issue. Are you creating a ServerSocket (or some other construct?) with some explicit value for backlog that is greater than 200? > >> Hi @jaikiran, I am running Apache Tomcat on Java. Tomcat has an acceptCount set to a large number (greater than 200). I believe Tomcat creates a ServerSocket with the configured acceptCount, and I suspect that it is not effective on Windows for the reasons mentioned above in this trail. > > Thank you for that detail, that's useful to know. Based on what you note and what's documented of that Connector attribute in Tomcat docs - https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Attributes_Standard%20Implementation_acceptCount, I think what you are suggesting is correct - the backlog might be playing a role here. > > If you get a chance to try this with Java 26 early access build, that would be a good experiment to verify that this change does indeed help this use case (I'll be curious to hear how that test goes). Hi @jaikiran - I have tested with the Java 26 early access build and can report that the issue i faced on Windows OS with TCP/HTTP connection refused errors even at relatively low concurrency has been resolved in this build. Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3179832921 From jpai at openjdk.org Tue Aug 12 15:38:24 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 12 Aug 2025 15:38:24 GMT Subject: RFR: 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ [v2] In-Reply-To: References: Message-ID: On Mon, 16 Jun 2025 09:44:13 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which proposes to enhance the implementation of `ServerSocket` and `ServerSocketChannel` to allow for `backlog` values to be greater than 200 on Windows? This addresses https://bugs.openjdk.org/browse/JDK-8330940. >> >> As noted in that enhancement request, right now on Windows, if the backlog is specified to be more than 200, then Windows caps it to a platform internal `SOMAXCONN`. As noted in the documentation here https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-listen applications can increase that limit by using the `SOMAXCONN_HINT` macro. That macro then adjusts the value to be between 200 and 65535, thus allowing for a higher backlog of connections. >> >> The commit in this PR uses this macro when the specified backlog is 200 or more. A new jtreg test has been introduced to verify this change. This test and other existing tests in tier1, tier2 and tier3 continue to pass. >> >> A similar restriction on the backlog value applies in Linux too https://github.com/torvalds/linux/blob/master/Documentation/networking/ip-sysctl.rst#tcp-variables. But from what I can see, unlike Windows, it cannot be adjusted when calling `listen()`. > > Jaikiran Pai has updated the pull request incrementally with four additional commits since the last revision: > > - include a test for AsynchronousServerSocketChannel > - System.err instead of System.out > - trim down code comment > - > 200 instead of >= 200 Thank you very much for running the test and reporting back. It's pleasing to hear that this enhancement addresses a genuine issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25819#issuecomment-3179884608 From liach at openjdk.org Tue Aug 12 16:03:17 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 12 Aug 2025 16:03:17 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v3] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 12:11:07 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Simplify added null checks > - Avoid code duplication by sprinkling some generics magic src/java.base/share/classes/java/lang/String.java line 851: > 849: } > 850: > 851: private static byte[] encodeWithEncoder(Charset cs, byte coder, byte[] val) { Is the type parameter here redundant? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2270409766 From bpb at openjdk.org Tue Aug 12 16:31:14 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 12 Aug 2025 16:31:14 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 06:42:52 GMT, Alan Bateman wrote: > normalize is to deal with user input, I don't think we should be using it here. This was intended to handle comparing paths with `..` and `.` like "a/b/c/../d/e" with "a/b/d/e" as there is no closer `Path` equivalent that I could see to `File.getCanonicalPath` that does not access the file system, i.e., to avoid `Path.toRealPath` and a consequent `NoSuchFileException`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2270504514 From lkorinth at openjdk.org Tue Aug 12 17:09:32 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Tue, 12 Aug 2025 17:09:32 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 Message-ID: This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. These fixes have been created when I have ploughed through test cases: JDK-8352719: Add an equals sign to the modules statement JDK-8352709: Remove bad timing annotations from WhileOpTest.java JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE CODETOOLS-7903961: Make default timeout configurable After the review, I will update the copyrights. I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. I got 4 timing related faults: 1) runtime/Thread/TestThreadDumpMonitorContention.java This is probably: https://bugs.openjdk.org/browse/JDK-8361370 2) sun/tools/jhsdb/BasicLauncherTest.java I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. 3) gc/stress/TestReclaimStringsLeaksMemory.java I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. 4) sun/security/ssl/X509KeyManager/CertChecking.java This is a new test that I got on last rebase. I have added a timeout of 480 to it. In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of default timeout factor", I have taken a few actions: 1) in testing(md|html): interpreted mode -> forced compilation mode 2) in MTTest.java: changed 1200 -> 400 (was 300 to begin with) I am now re-running tier 1-8. ------------- Commit messages: - 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 Changes: https://git.openjdk.org/jdk/pull/26749/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8260555 Stats: 598 lines in 297 files changed: 49 ins; 91 del; 458 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From bpb at openjdk.org Tue Aug 12 17:42:24 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 12 Aug 2025 17:42:24 GMT Subject: Integrated: 8361209: (bf) Use CharSequence::getChars for StringCharBuffer bulk get methods In-Reply-To: References: Message-ID: <4k-Zr8rf56argah_YubWr489oUEkHoIC9VIbosfXIXw=.e6d99f9d-554b-4868-a748-85bc72e2db0a@github.com> On Thu, 10 Jul 2025 20:27:52 GMT, Brian Burkhalter wrote: > For `CharBuffer`s created from a `CharSequence`, use `CharSequence.getChars` to perform bulk gets instead of successively copying single characters. This pull request has now been integrated. Changeset: d0239826 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/d023982600f8bb19053f579710953aa29e0f30c5 Stats: 102 lines in 3 files changed: 93 ins; 0 del; 9 mod 8361209: (bf) Use CharSequence::getChars for StringCharBuffer bulk get methods Reviewed-by: rriggs, alanb ------------- PR: https://git.openjdk.org/jdk/pull/26251 From cjplummer at openjdk.org Tue Aug 12 17:54:13 2025 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 12 Aug 2025 17:54:13 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. @lkorinth Can you send me a link to the failure? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3180396310 From vyazici at openjdk.org Tue Aug 12 19:29:28 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 19:29:28 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v4] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Remove redundant type parameters ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/f536a341..c5ddfe62 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=02-03 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Tue Aug 12 19:29:29 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 12 Aug 2025 19:29:29 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v3] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 15:58:13 GMT, Chen Liang wrote: >> Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: >> >> - Simplify added null checks >> - Avoid code duplication by sprinkling some generics magic > > src/java.base/share/classes/java/lang/String.java line 851: > >> 849: } >> 850: >> 851: private static byte[] encodeWithEncoder(Charset cs, byte coder, byte[] val) { > > Is the type parameter here redundant? Yes, it is! Removed this one and other 3 in c5ddfe62eb8. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2270957899 From syan at openjdk.org Wed Aug 13 01:50:14 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 13 Aug 2025 01:50:14 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... test/hotspot/jtreg/compiler/c1/TestPinnedIntrinsics.java line 25: > 23: > 24: /* > 25: * @test Should we need to update the copyright year for the touch files ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2271883564 From syan at openjdk.org Wed Aug 13 01:54:16 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 13 Aug 2025 01:54:16 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... test/hotspot/jtreg/compiler/c2/TestStressRecompilation.java line 29: > 27: * @requires vm.debug > 28: * @summary Test running with StressRecompilation enabled. > 29: * @run main/othervm/timeout=480 -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+StressRecompilation I think the default value(120s) will be enough? On my machine this test use 11.546 senonds to finish. > grep "elapsed time" tmp/compiler/classUnloading/methodUnloading/TestOverloadCompileQueues.jtr -rn 55:elapsed time (seconds): 0.581 66:elapsed time (seconds): 0.575 116:elapsed time (seconds): 3.088 162:elapsed time (seconds): 0.001 173:elapsed time (seconds): 11.546 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2271888024 From sspitsyn at openjdk.org Wed Aug 13 07:29:11 2025 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Wed, 13 Aug 2025 07:29:11 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... I've reviewed the Serviceability related tweaks and I'm okay with them in general. But I'm curious if you do not see any timeouts with this anymore. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26749#pullrequestreview-3114280042 From aturbanov at openjdk.org Wed Aug 13 09:47:17 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 13 Aug 2025 09:47:17 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... test/langtools/tools/lib/toolbox/ToolBox.java line 480: > 478: > 479: private static final int RETRY_DELETE_MILLIS = isWindows() ? 500 : 0; > 480: private static final int MAX_RETRY_DELETE_MILLIS = isWindows() ? 60 * 1000 : 0; Suggestion: private static final int MAX_RETRY_DELETE_MILLIS = isWindows() ? 60 * 1000 : 0; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2272745651 From pminborg at openjdk.org Wed Aug 13 11:17:15 2025 From: pminborg at openjdk.org (Per Minborg) Date: Wed, 13 Aug 2025 11:17:15 GMT Subject: RFR: 8359119: Change Charset to use StableValue [v3] In-Reply-To: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> References: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> Message-ID: On Tue, 5 Aug 2025 09:08:47 GMT, Per Minborg wrote: >> Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`. >> >> This PR passes tier1, tier2, and tier3 tests on multiple platforms. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Address comments in PR > - Merge branch 'master' into stablify-charset > - Revert for loop > - Revert more > - Revert changes > - Add stable value functionality All comments above have been addressed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25727#issuecomment-3183372756 From lkorinth at openjdk.org Wed Aug 13 13:09:13 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 13:09:13 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 01:47:43 GMT, SendaoYan wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > test/hotspot/jtreg/compiler/c1/TestPinnedIntrinsics.java line 25: > >> 23: >> 24: /* >> 25: * @test > > Should we need to update the copyright year for the touched files `After the review, I will update the copyrights.` It is IMO easier to review big changes without the noise. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2273410872 From lkorinth at openjdk.org Wed Aug 13 13:21:11 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 13:21:11 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: <4q0047gChugbkkv-W0lis2E8nXVWh8YGVJiBehoojLY=.0b9055a2-f038-4247-82a9-7c60ee9f6637@github.com> On Tue, 12 Aug 2025 17:52:02 GMT, Chris Plummer wrote: > > sun/tools/jhsdb/BasicLauncherTest.java > > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > > @lkorinth Can you send me a link to the failure? I sent it to you on email. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3183896453 From erikj at openjdk.org Wed Aug 13 13:28:18 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Wed, 13 Aug 2025 13:28:18 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... make/RunTests.gmk line 939: > 937: > 938: JTREG_AUTO_PROBLEM_LISTS := > 939: JTREG_AUTO_TIMEOUT_FACTOR := 1 # IT MAKES NO SENCE TO CHANGE IT. Fix individual test cases that time out instead. I'm not sure about this comment, but if we keep it, please move it to the line above and break lines as appropriate. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2273468852 From lkorinth at openjdk.org Wed Aug 13 13:36:13 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 13:36:13 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 01:51:44 GMT, SendaoYan wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > test/hotspot/jtreg/compiler/c2/TestStressRecompilation.java line 29: > >> 27: * @requires vm.debug >> 28: * @summary Test running with StressRecompilation enabled. >> 29: * @run main/othervm/timeout=480 -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+StressRecompilation > > I think the default value(120s) will be enough? On my machine this test use 11.546 senonds to finish. > > >> grep "elapsed time" tmp/compiler/classUnloading/methodUnloading/TestOverloadCompileQueues.jtr -rn > 55:elapsed time (seconds): 0.581 > 66:elapsed time (seconds): 0.575 > 116:elapsed time (seconds): 3.088 > 162:elapsed time (seconds): 0.001 > 173:elapsed time (seconds): 11.546 I have only (to my knowledge) updated test cases that has timed out for me. We have some not very modern test machines that is slower. That in combination with a debug build, in combination with a timeout factor of 0.7 might have made the test time out. Unfortunately I no longer have the logs for this failure so I can not check if the machine was failing because it was low on memory etc. I still think it is reasonable to keep the old timeout of 480. I have no intuitive feeling for how expensive `-XX:+StressRecompilation` is. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2273488236 From lkorinth at openjdk.org Wed Aug 13 13:53:12 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 13:53:12 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: <5nc1SBXnwAOJJvnrbMyPIsre61u--GxMHSffdDf8qUU=.77100025-4b9e-4e0a-b71d-df590df5f9ba@github.com> On Wed, 13 Aug 2025 07:26:59 GMT, Serguei Spitsyn wrote: > I've reviewed the Serviceability related tweaks and I'm okay with them in general. But I'm curious if you do not see any timeouts with this anymore. I only got the four timeouts described in the description, I got a few other failures as well that was not timeout related. I sent you a link to the test results in an email. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3184026177 From lkorinth at openjdk.org Wed Aug 13 14:22:08 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 14:22:08 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v2] In-Reply-To: References: Message-ID: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: After suggestions from Erik and Andrey ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/ac47dbdc..dbe42964 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=00-01 Stats: 3 lines in 2 files changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From lkorinth at openjdk.org Wed Aug 13 14:22:10 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 14:22:10 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v2] In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 13:25:48 GMT, Erik Joelsson wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> After suggestions from Erik and Andrey > > make/RunTests.gmk line 939: > >> 937: >> 938: JTREG_AUTO_PROBLEM_LISTS := >> 939: JTREG_AUTO_TIMEOUT_FACTOR := 1 # IT MAKES NO SENCE TO CHANGE IT. Fix individual test cases that time out instead. > > I'm not sure about this comment, but if we keep it, please move it to the line above and break lines as appropriate. I updated it to "Please reach consensus before changing this. It was not easy changing it to a `1`. " I also did not break the comment as it was shorter than line 933 above it. Is it acceptable now? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2273621868 From lkorinth at openjdk.org Wed Aug 13 14:22:11 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 13 Aug 2025 14:22:11 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v2] In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 09:44:33 GMT, Andrey Turbanov wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> After suggestions from Erik and Andrey > > test/langtools/tools/lib/toolbox/ToolBox.java line 480: > >> 478: >> 479: private static final int RETRY_DELETE_MILLIS = isWindows() ? 500 : 0; >> 480: private static final int MAX_RETRY_DELETE_MILLIS = isWindows() ? 60 * 1000 : 0; > > Suggestion: > > private static final int MAX_RETRY_DELETE_MILLIS = isWindows() ? 60 * 1000 : 0; Fixed! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2273614076 From alanb at openjdk.org Wed Aug 13 16:00:13 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 13 Aug 2025 16:00:13 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 16:28:47 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 429: >> >>> 427: >>> 428: // neither exists, compare normalized paths without filesystem access >>> 429: return obj1.normalize().equals(obj2.normalize()); >> >> normalize is to deal with user input, I don't think we should be using it here. >> >> (I will try to add review the changes soon but I'm concerned that this will require spec changes). > >> normalize is to deal with user input, I don't think we should be using it here. > > This was intended to handle comparing paths with `..` and `.` like "a/b/c/../d/e" with "a/b/d/e" as there is no closer `Path` equivalent that I could see to `File.getCanonicalPath` that does not access the file system, i.e., to avoid `Path.toRealPath` and a consequent `NoSuchFileException`. normalize collapses the path so I'm concerned about foo/.. in one and bar/.. in the other. They may collapse down to the equal paths, which may not be the right answer. I think the approach of collecting the file keys along the chain is good, a match means the method can return true. Also the case where one exists and the other doesn't is good. Beyond that then I think the method will have to throw as it can't give an answer. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2273903738 From alanb at openjdk.org Wed Aug 13 16:04:19 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 13 Aug 2025 16:04:19 GMT Subject: RFR: 8359119: Change Charset to use StableValue [v3] In-Reply-To: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> References: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> Message-ID: <0PiCFIKC9MxdStAXGgyhouwAfPuUKh_jCY9MTJyB-MY=.e91c7801-f279-4c10-a732-ea9497620317@github.com> On Tue, 5 Aug 2025 09:08:47 GMT, Per Minborg wrote: >> Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`. >> >> This PR passes tier1, tier2, and tier3 tests on multiple platforms. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Address comments in PR > - Merge branch 'master' into stablify-charset > - Revert for loop > - Revert more > - Revert changes > - Add stable value functionality Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25727#pullrequestreview-3116665856 From bpb at openjdk.org Wed Aug 13 16:15:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 13 Aug 2025 16:15:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 15:57:39 GMT, Alan Bateman wrote: > normalize collapses the path so I'm concerned about foo/.. in one and bar/.. in the other. They may collapse down to the equal paths, which may not be the right answer. Good point. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2273940046 From bpb at openjdk.org Wed Aug 13 16:56:52 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 13 Aug 2025 16:56:52 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: Message-ID: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Remove assertion that two non-existent files with equal normalized paths are equal ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/a7a8b416..1aac01aa Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=00-01 Stats: 4 lines in 2 files changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Wed Aug 13 16:56:52 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 13 Aug 2025 16:56:52 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 16:12:07 GMT, Brian Burkhalter wrote: >> normalize collapses the path so I'm concerned about foo/.. in one and bar/.. in the other. They may collapse down to the equal paths, which may not be the right answer. >> >> I think the approach of collecting the file keys along the chain is good, a match means the method can return true. Also the case where one exists and the other doesn't is good. Beyond that then I think the method will have to throw as it can't give an answer. > >> normalize collapses the path so I'm concerned about foo/.. in one and bar/.. in the other. They may collapse down to the equal paths, which may not be the right answer. > > Good point. Use of normalized paths removed in 1aac01a. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2274057104 From alanb at openjdk.org Thu Aug 14 06:45:11 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 14 Aug 2025 06:45:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Wed, 13 Aug 2025 16:56:52 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Remove assertion that two non-existent files with equal normalized paths are equal src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 394: > 392: // check existence while following linkx > 393: boolean exists1 = exists(file1); > 394: boolean exists2 = exists(file2); Did you try to using UnixFileAttribtues.getIfExists? That would remove the need for access(2) from the common case. We can add getIfExists(UnixPath path, boolean followLinks) if needed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2275630370 From duke at openjdk.org Thu Aug 14 07:12:15 2025 From: duke at openjdk.org (ExE Boss) Date: Thu, 14 Aug 2025 07:12:15 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 16:53:12 GMT, Brian Burkhalter wrote: >>> normalize collapses the path so I'm concerned about foo/.. in one and bar/.. in the other. They may collapse down to the equal paths, which may not be the right answer. >> >> Good point. > > Use of normalized paths removed in 1aac01a. Note?that `Path::equals` on?**Windows** is?also?wrong when the?path?contains case?sensitive directories and?the?path element isn?t case?sensitively?equal in?those?directories. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2275680441 From duke at openjdk.org Thu Aug 14 07:12:17 2025 From: duke at openjdk.org (ExE Boss) Date: Thu, 14 Aug 2025 07:12:17 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Wed, 13 Aug 2025 16:56:52 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Remove assertion that two non-existent files with equal normalized paths are equal src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 478: > 476: > 477: // neither exists, compare normalized paths without filesystem access > 478: return obj1.normalize().equals(obj2.normalize()); This `Path::normalize` call?was?missed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2275684211 From bpb at openjdk.org Thu Aug 14 15:06:19 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 15:06:19 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 06:41:52 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8154364: Remove assertion that two non-existent files with equal normalized paths are equal > > src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 394: > >> 392: // check existence while following linkx >> 393: boolean exists1 = exists(file1); >> 394: boolean exists2 = exists(file2); > > Did you try to using UnixFileAttribtues.getIfExists? That would remove the need for access(2) from the common case. We can add getIfExists(UnixPath path, boolean followLinks) if needed. No, but I'll investigate. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2276898431 From bpb at openjdk.org Thu Aug 14 15:06:23 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 15:06:23 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: <71EySYtMHYkccDJQN7ElNmwVOkgF1O8RuDx2b-eM6K8=.c1d7f790-c79a-47da-b40f-954d38a34b5b@github.com> On Thu, 14 Aug 2025 07:09:24 GMT, ExE Boss wrote: > This `Path::normalize` call was missed. Yes, I realized this myself a while ago. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2276894871 From bpb at openjdk.org Thu Aug 14 15:14:58 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 15:14:58 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v3] In-Reply-To: References: Message-ID: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Propagate change of previous commit to Windows ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/1aac01aa..f25a3725 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=01-02 Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Thu Aug 14 15:14:58 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 15:14:58 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: <71EySYtMHYkccDJQN7ElNmwVOkgF1O8RuDx2b-eM6K8=.c1d7f790-c79a-47da-b40f-954d38a34b5b@github.com> References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> <71EySYtMHYkccDJQN7ElNmwVOkgF1O8RuDx2b-eM6K8=.c1d7f790-c79a-47da-b40f-954d38a34b5b@github.com> Message-ID: On Thu, 14 Aug 2025 15:02:26 GMT, Brian Burkhalter wrote: >> src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 478: >> >>> 476: >>> 477: // neither exists, compare normalized paths without filesystem access >>> 478: return obj1.normalize().equals(obj2.normalize()); >> >> This `Path::normalize` call?was?missed. > >> This `Path::normalize` call was missed. > > Yes, I realized this myself a while ago. Fixed in f25a372. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2276917283 From bpb at openjdk.org Thu Aug 14 15:21:13 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 15:21:13 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 15:03:48 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 394: >> >>> 392: // check existence while following linkx >>> 393: boolean exists1 = exists(file1); >>> 394: boolean exists2 = exists(file2); >> >> Did you try to using UnixFileAttribtues.getIfExists? That would remove the need for access(2) from the common case. We can add getIfExists(UnixPath path, boolean followLinks) if needed. > > No, but I'll investigate. > Did you try to using UnixFileAttribtues.getIfExists? I think you're correct that this would speed up the common case a bit, but as implied, it would require adding `getIfExists` which does not follow links. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2276941825 From bpb at openjdk.org Thu Aug 14 16:20:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 16:20:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 15:18:46 GMT, Brian Burkhalter wrote: >> No, but I'll investigate. > >> Did you try to using UnixFileAttribtues.getIfExists? > > I think you're correct that this would speed up the common case a bit, but as implied, it would require adding `getIfExists` which does not follow links. For some reason TBD, `UnixFileAttributes.get` succeeds with a symlink loop but `UnixFileAttributes.getIfExists` fails with `ELOOP`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277090826 From alanb at openjdk.org Thu Aug 14 16:20:14 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 14 Aug 2025 16:20:14 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v3] In-Reply-To: References: Message-ID: On Thu, 14 Aug 2025 15:14:58 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Propagate change of previous commit to Windows src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 430: > 428: // neither exist and comparison of normalized paths is problematic, > 429: // so return false > 430: return false; I think you can drop "comparison of normalized paths is problematic" as it begs too many questions for anyone looking at this code. src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 423: > 421: @Override > 422: public boolean isSameFile(Path obj1, Path obj2) throws IOException { > 423: // toWindowsPath verifies its argument is a non-null UnixPath UnixPath - WindowsPath src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 435: > 433: // check existence > 434: boolean exists1 = exists(obj1); > 435: boolean exists2 = exists(obj2); exists does the openForReadAttributeAccess+readAttributes+CloseHandle so it looks like the change means it will do it twice for each file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277086814 PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277084675 PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277084346 From bpb at openjdk.org Thu Aug 14 16:44:10 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 16:44:10 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:17:59 GMT, Brian Burkhalter wrote: >>> Did you try to using UnixFileAttribtues.getIfExists? >> >> I think you're correct that this would speed up the common case a bit, but as implied, it would require adding `getIfExists` which does not follow links. > > For some reason TBD, `UnixFileAttributes.get` succeeds with a symlink loop but `UnixFileAttributes.getIfExists` fails with `ELOOP`. The `ELOOP` apparently is from the `stat` syscall and does not occur in the current version because `access` is called before `stat` and does not fail in that way. So I am not sure that `getIfExists` is the way to go here unless we want to punt the link loop cases. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277142337 From alanb at openjdk.org Thu Aug 14 16:44:11 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 14 Aug 2025 16:44:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:37:51 GMT, Brian Burkhalter wrote: >> For some reason TBD, `UnixFileAttributes.get` succeeds with a symlink loop but `UnixFileAttributes.getIfExists` fails with `ELOOP`. > > The `ELOOP` apparently is from the `stat` syscall and does not occur in the current version because `access` is called before `stat` and does not fail in that way. So I am not sure that `getIfExists` is the way to go here unless we want to punt the link loop cases. Are you testing a loop in the file system? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277146480 From bpb at openjdk.org Thu Aug 14 16:44:11 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 16:44:11 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:39:46 GMT, Alan Bateman wrote: > Are you testing a loop in the file system? Yes, in the `linkLoop` sub-test of `IsSameFile`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277150448 From alanb at openjdk.org Thu Aug 14 16:48:10 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 14 Aug 2025 16:48:10 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:41:15 GMT, Brian Burkhalter wrote: >> Are you testing a loop in the file system? > >> Are you testing a loop in the file system? > > Yes, in the `linkLoop` sub-test of `IsSameFile`. So ELOOP is correct and IsSameFile should thrown, right? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277164939 From bpb at openjdk.org Thu Aug 14 16:56:13 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 16:56:13 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:45:41 GMT, Alan Bateman wrote: >>> Are you testing a loop in the file system? >> >> Yes, in the `linkLoop` sub-test of `IsSameFile`. > > So ELOOP is correct and IsSameFile should thrown, right? It depends whether we want to support a case such as ```L1 -> L2 -> L3 -> L1 ...```. Depending on what is specified, then for example `isSameFile(L1,L3)` should either throw or return `true`. In the current version, it is the latter. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277176512 From alanb at openjdk.org Thu Aug 14 16:56:15 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 14 Aug 2025 16:56:15 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:49:14 GMT, Brian Burkhalter wrote: >> So ELOOP is correct and IsSameFile should thrown, right? > > It depends whether we want to support a case such as > ```L1 -> L2 -> L3 -> L1 ...```. > Depending on what is specified, then for example `isSameFile(L1,L3)` should either throw or return `true`. In the current version, it is the latter. It's a loop in the file system and not unreasonable for isSameFile to throw. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277183692 From bpb at openjdk.org Thu Aug 14 16:56:16 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 16:56:16 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v2] In-Reply-To: References: <26VIvSZrRd0oIwg05KXupAwvpZF3Dll2e0-iLxiIlZU=.f43e98b0-1146-4317-843e-f819469310f4@github.com> Message-ID: On Thu, 14 Aug 2025 16:51:56 GMT, Alan Bateman wrote: >> It depends whether we want to support a case such as >> ```L1 -> L2 -> L3 -> L1 ...```. >> Depending on what is specified, then for example `isSameFile(L1,L3)` should either throw or return `true`. In the current version, it is the latter. > > It's a loop in the file system and not unreasonable for isSameFile to throw. Okay, then I'll switch it to use `getIfExists` and update the test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277186957 From bpb at openjdk.org Thu Aug 14 19:00:12 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 14 Aug 2025 19:00:12 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v3] In-Reply-To: References: Message-ID: On Thu, 14 Aug 2025 16:15:00 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8154364: Propagate change of previous commit to Windows > > src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 435: > >> 433: // check existence >> 434: boolean exists1 = exists(obj1); >> 435: boolean exists2 = exists(obj2); > > exists does the openForReadAttributeAccess+readAttributes+CloseHandle so it looks like the change means it will do it twice for each file. Right, the Windows implementation is not good and needs to be rethought. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2277483808 From dnsimon at openjdk.org Thu Aug 14 19:33:15 2025 From: dnsimon at openjdk.org (Doug Simon) Date: Thu, 14 Aug 2025 19:33:15 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v2] In-Reply-To: References: Message-ID: On Wed, 13 Aug 2025 14:22:08 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > After suggestions from Erik and Andrey > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. Would you mind also running tier9 to avoid surprises there. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3189640422 From bpb at openjdk.org Fri Aug 15 00:19:37 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 00:19:37 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v4] In-Reply-To: References: Message-ID: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Unix cleanup ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/f25a3725..29491bf9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=02-03 Stats: 71 lines in 3 files changed: 41 ins; 20 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From mbaesken at openjdk.org Fri Aug 15 07:08:53 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Fri, 15 Aug 2025 07:08:53 GMT Subject: RFR: 8365543: [aix] Java_sun_nio_fs_UnixNativeDispatcher_init needs adjustment for AIX for some system call functions Message-ID: Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. ------------- Commit messages: - JDK-8365543 Changes: https://git.openjdk.org/jdk/pull/26793/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26793&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365543 Stats: 16 lines in 2 files changed: 7 ins; 8 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26793.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26793/head:pull/26793 PR: https://git.openjdk.org/jdk/pull/26793 From jkern at openjdk.org Fri Aug 15 07:52:09 2025 From: jkern at openjdk.org (Joachim Kern) Date: Fri, 15 Aug 2025 07:52:09 GMT Subject: RFR: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. LGTM ------------- Marked as reviewed by jkern (Committer). PR Review: https://git.openjdk.org/jdk/pull/26793#pullrequestreview-3123182721 From stuefe at openjdk.org Fri Aug 15 08:08:09 2025 From: stuefe at openjdk.org (Thomas Stuefe) Date: Fri, 15 Aug 2025 08:08:09 GMT Subject: RFR: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. +1 ------------- Marked as reviewed by stuefe (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26793#pullrequestreview-3123203684 From goetz at openjdk.org Fri Aug 15 08:08:10 2025 From: goetz at openjdk.org (Goetz Lindenmaier) Date: Fri, 15 Aug 2025 08:08:10 GMT Subject: RFR: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. Impressive subtle difference in function names. Looks good. Thanks for cleaning up the #ifdefs along with this. ------------- Marked as reviewed by goetz (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26793#pullrequestreview-3123207200 From lkorinth at openjdk.org Fri Aug 15 11:43:33 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 15 Aug 2025 11:43:33 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/dbe42964..8fa40e7d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From lkorinth at openjdk.org Fri Aug 15 11:59:12 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 15 Aug 2025 11:59:12 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 11:43:33 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD Added three new `/timeout=480` after the last run. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3191343090 From syan at openjdk.org Fri Aug 15 14:08:12 2025 From: syan at openjdk.org (SendaoYan) Date: Fri, 15 Aug 2025 14:08:12 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 11:43:33 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD make/RunTests.gmk line 940: > 938: JTREG_AUTO_PROBLEM_LISTS := > 939: # Please reach consensus before changing this. It was not easy changing it to a `1`. > 940: JTREG_AUTO_TIMEOUT_FACTOR := 1 Since the default value of JTREG_AUTO_TIMEOUT_FACTOR set to 1 by default, then the value of [JTREG_AUTO_TIMEOUT_FACTOR](https://github.com/lkorinth/jdk/blob/dbe42964371a38b2c6cd9e842c5b28ca4ac15506/make/RunTests.gmk#L944) when run with -Xcomp should be change from 10 to 2.5() ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2279056261 From rriggs at openjdk.org Fri Aug 15 15:54:22 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 15 Aug 2025 15:54:22 GMT Subject: RFR: 8359119: Change Charset to use StableValue [v3] In-Reply-To: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> References: <_slUSdx6gVElcqEg71xpeHsa99DhZ3YteV84gZvR5Hc=.73afbad1-6ba8-487b-ac44-b6cc09fdafc7@github.com> Message-ID: On Tue, 5 Aug 2025 09:08:47 GMT, Per Minborg wrote: >> Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`. >> >> This PR passes tier1, tier2, and tier3 tests on multiple platforms. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Address comments in PR > - Merge branch 'master' into stablify-charset > - Revert for loop > - Revert more > - Revert changes > - Add stable value functionality Looks good. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25727#pullrequestreview-3124350887 From bpb at openjdk.org Fri Aug 15 17:05:10 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 17:05:10 GMT Subject: RFR: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: <_H5mrv62vVHZFoTG1iLDYu4ViLys6Ulqq2_6dL0O3zg=.90cbb747-24f7-4fc7-ab26-d2fc41f6e204@github.com> On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. Looks all right to me also, but I'll abstain from approving as it's AIX. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26793#issuecomment-3192190515 From alanb at openjdk.org Fri Aug 15 17:15:11 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 15 Aug 2025 17:15:11 GMT Subject: RFR: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26793#pullrequestreview-3124606292 From bpb at openjdk.org Fri Aug 15 18:28:56 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 18:28:56 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v5] In-Reply-To: References: Message-ID: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Revert Windows changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/29491bf9..1f1b23dd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=03-04 Stats: 40 lines in 1 file changed: 3 ins; 17 del; 20 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Fri Aug 15 18:28:56 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 18:28:56 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v4] In-Reply-To: References: Message-ID: <0SdTtBXBnDh8O00iabIKIBd8I5mBAFVZpjXAkmAjzgM=.dae80ba1-087e-488b-8730-9e6b8c88647a@github.com> On Fri, 15 Aug 2025 00:19:37 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Unix cleanup This request is now constrained to Unix as links are not used as widely on Windows. The Windows case might be addressed by a separate issue. Caveat: The test needs to be limited to not Windows so one more commit is needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26736#issuecomment-3192375529 PR Comment: https://git.openjdk.org/jdk/pull/26736#issuecomment-3192376648 From bpb at openjdk.org Fri Aug 15 18:31:42 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 18:31:42 GMT Subject: RFR: 8154364: Files.isSameFile() throws NoSuchFileException with broken symbolic links [v6] In-Reply-To: References: Message-ID: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Constrain test to non-Windows ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/1f1b23dd..db58e692 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=04-05 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Fri Aug 15 19:12:29 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 19:12:29 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v7] In-Reply-To: References: Message-ID: <0RfpOi3g_4liJOzmnuGVqfcPjHaOq2tbcrpbz4Htxnw=.31faf93f-5221-43d5-95ff-620e15e4916f@github.com> > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Remove vestigial @DisabledOnOs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/db58e692..85f3cdb3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=05-06 Stats: 4 lines in 1 file changed: 0 ins; 4 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Fri Aug 15 20:43:41 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 15 Aug 2025 20:43:41 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: References: Message-ID: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Put changes to Misc.java in platform-specific blocks ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/85f3cdb3..8b85dfd7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=06-07 Stats: 31 lines in 1 file changed: 26 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From alanb at openjdk.org Sat Aug 16 07:07:16 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 16 Aug 2025 07:07:16 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> Message-ID: On Fri, 15 Aug 2025 20:43:41 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Put changes to Misc.java in platform-specific blocks src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 88: > 86: static UnixFileAttributes getIfExists(UnixPath path) > 87: throws UnixException > 88: { It would be nice if getIfExists(path) could be implemented as getIfExists(path, true) but it can't because the former doesn't need an exception when the file doesn't exists where the latter does. Something to look into sometime. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2280283317 From alanb at openjdk.org Sat Aug 16 07:32:15 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 16 Aug 2025 07:32:15 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> Message-ID: On Fri, 15 Aug 2025 20:43:41 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Put changes to Misc.java in platform-specific blocks src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 379: > 377: } > 378: return keys; > 379: } I'm a bit puzzled as to why it looks at each element in the path. It should be possible to just enumerate the files of the sym links that exist, something like this var fileKeys = new HashSet(); while (path != null) { UnixFileAttributes attrs = UnixFileAttributes.getIfExists(path, false); if (attrs != null && attrs.isSymbolicLink()) { fileKeys.add(attrs.fileKey()); path = (UnixPath) readSymbolicLink(path); } else { path = null; } } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2280292509 From stephen_flav at hotmail.com Sat Aug 16 20:25:24 2025 From: stephen_flav at hotmail.com (stephen_flav at hotmail.com) Date: Sat, 16 Aug 2025 21:25:24 +0100 Subject: Thoughts on generalizing transferTo/transferFrom beyond FileChannel? Message-ID: An HTML attachment was scrubbed... URL: From pminborg at openjdk.org Mon Aug 18 05:35:20 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 18 Aug 2025 05:35:20 GMT Subject: Integrated: 8359119: Change Charset to use StableValue In-Reply-To: References: Message-ID: On Tue, 10 Jun 2025 14:09:03 GMT, Per Minborg wrote: > Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`. > > This PR passes tier1, tier2, and tier3 tests on multiple platforms. This pull request has now been integrated. Changeset: f364fcab Author: Per Minborg URL: https://git.openjdk.org/jdk/commit/f364fcab792ed5a14e5c2779fa85ecc9d6915ae3 Stats: 86 lines in 1 file changed: 26 ins; 30 del; 30 mod 8359119: Change Charset to use StableValue Reviewed-by: alanb, rriggs ------------- PR: https://git.openjdk.org/jdk/pull/25727 From mbaesken at openjdk.org Mon Aug 18 07:13:13 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Mon, 18 Aug 2025 07:13:13 GMT Subject: RFR: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. Thanks for the reviews ! ------------- PR Comment: https://git.openjdk.org/jdk/pull/26793#issuecomment-3195403228 From mbaesken at openjdk.org Mon Aug 18 07:17:20 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Mon, 18 Aug 2025 07:17:20 GMT Subject: Integrated: 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 06:58:35 GMT, Matthias Baesken wrote: > Java_sun_nio_fs_UnixNativeDispatcher_init currently misses to set the correct OS functions for my_openat_func and my_fstatat_func on AIX ; this should be adjusted. This pull request has now been integrated. Changeset: 166ea12d Author: Matthias Baesken URL: https://git.openjdk.org/jdk/commit/166ea12d73c7a40a1a26dc586e3db9d9430c068f Stats: 16 lines in 2 files changed: 7 ins; 8 del; 1 mod 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX Co-authored-by: Joachim Kern Reviewed-by: jkern, stuefe, goetz, alanb ------------- PR: https://git.openjdk.org/jdk/pull/26793 From lkorinth at openjdk.org Mon Aug 18 09:10:13 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 09:10:13 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 14:05:49 GMT, SendaoYan wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD > > make/RunTests.gmk line 940: > >> 938: JTREG_AUTO_PROBLEM_LISTS := >> 939: # Please reach consensus before changing this. It was not easy changing it to a `1`. >> 940: JTREG_AUTO_TIMEOUT_FACTOR := 1 > > Since the default value of JTREG_AUTO_TIMEOUT_FACTOR set to 1 by default, then the value of [JTREG_AUTO_TIMEOUT_FACTOR](https://github.com/lkorinth/jdk/blob/dbe42964371a38b2c6cd9e842c5b28ca4ac15506/make/RunTests.gmk#L944) when run with -Xcomp should be change from 10 to 2.5() It is unclear to me if the author meant this to be `2.5` more than normal or `10` more than JTREG default, or a `multiplier that seems to work`. It does not bother me _more_ if it is a `10` then a `2.5`, as it needs to have a value that is not the multiplicative identity value. I will not change this, the change I have made is already large enough and I want this to be integrated ASAP. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2281781536 From lkorinth at openjdk.org Mon Aug 18 09:18:12 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 09:18:12 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Mon, 18 Aug 2025 09:07:54 GMT, Leo Korinth wrote: >> make/RunTests.gmk line 940: >> >>> 938: JTREG_AUTO_PROBLEM_LISTS := >>> 939: # Please reach consensus before changing this. It was not easy changing it to a `1`. >>> 940: JTREG_AUTO_TIMEOUT_FACTOR := 1 >> >> Since the default value of JTREG_AUTO_TIMEOUT_FACTOR set to 1 by default, then the value of [JTREG_AUTO_TIMEOUT_FACTOR](https://github.com/lkorinth/jdk/blob/dbe42964371a38b2c6cd9e842c5b28ca4ac15506/make/RunTests.gmk#L944) when run with -Xcomp should be change from 10 to 2.5() > > It is unclear to me if the author meant this to be `2.5` more than normal or `10` more than JTREG default, or a `multiplier that seems to work`. It does not bother me _more_ if it is a `10` then a `2.5`, as it needs to have a value that is not the multiplicative identity value. I will not change this, the change I have made is already large enough and I want this to be integrated ASAP. It is also something that can be changed later, in a follow up fix. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2281802454 From lkorinth at openjdk.org Mon Aug 18 09:36:13 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 09:36:13 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v2] In-Reply-To: References: Message-ID: <3l5I9q7S4O_0gH6mvxy3P21f1JxqcQKNsnBTN7rWhmc=.ddcf4337-dc6e-493d-ae07-5bd4affb9321@github.com> On Thu, 14 Aug 2025 19:30:30 GMT, Doug Simon wrote: > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > Would you mind also running tier9 to avoid surprises there. I had problems doing this, and I just want to say that I have not run tier9 (I have talked to Douglas off-list). ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3195900610 From lkorinth at openjdk.org Mon Aug 18 09:43:14 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 09:43:14 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: <9GMJWT-CNwqDVALuPdRR9EDs5G1c2jUr3y887qw2_EU=.1a7347a2-d1e5-427d-aeda-6924e2db39ba@github.com> On Fri, 15 Aug 2025 11:43:33 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD If there are no mayor objections, I will update the copyrights before I leave work today. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3195923727 From dfuchs at openjdk.org Mon Aug 18 11:38:14 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 18 Aug 2025 11:38:14 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: <-1NjyGdZla4kxc5tKPvakW_aqwjNcNXt4ibAf3WndRU=.21ac795a-b7ee-44ac-a155-70e1186c8148@github.com> On Fri, 15 Aug 2025 11:43:33 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD Hi Leo, I played a bit with your changes and I observed intermittent timeout failures for the following tests: java/net/httpclient/CancelledResponse.java java/net/httpclient/whitebox/FlowTestDriver.java The first test failing more frequently. Could you please add /timeout=480 to these two tests as well? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3196281299 From rriggs at openjdk.org Mon Aug 18 13:15:11 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 18 Aug 2025 13:15:11 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 11:43:33 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD Generally, changes with this many changed files are broken down into smaller PRs to make the review easier and more conclusive. In this case, hotspot, jdk, and langtools might have been good groupings. The reviews could be done in parallel and committed with the final change to jtreg when they are all approved. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3196793327 From lkorinth at openjdk.org Mon Aug 18 14:34:12 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 14:34:12 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Mon, 18 Aug 2025 13:12:41 GMT, Roger Riggs wrote: > Generally, changes with this many changed files are broken down into smaller PRs to make the review easier and more conclusive. In this case, hotspot, jdk, and langtools might have been good groupings. The reviews could be done in parallel and committed with the final change to jtreg when they are all approved. Noted. I did it so reviewers could se the change "as a whole". Feel free to review a part of the change! ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3197186029 From lmesnik at openjdk.org Mon Aug 18 15:01:12 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Mon, 18 Aug 2025 15:01:12 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Fri, 15 Aug 2025 11:43:33 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD Thank you for fixing this! I think the changes are good. ------------- Marked as reviewed by lmesnik (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26749#pullrequestreview-3128749995 From bpb at openjdk.org Mon Aug 18 16:08:13 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 18 Aug 2025 16:08:13 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> Message-ID: <-NhcAIuO62gb0PvliVwQNMtHsgsHLcQplbBRf8SpxR0=.c722ee76-69c7-4fd9-8dbe-8231e5411e63@github.com> On Sat, 16 Aug 2025 07:29:20 GMT, Alan Bateman wrote: > or better, just return the file key of last accessible link in the chain, something like this, and then just check if they are equal Thanks for the suggestion, will investigate. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2282832314 From bpb at openjdk.org Mon Aug 18 16:12:13 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 18 Aug 2025 16:12:13 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> Message-ID: On Fri, 15 Aug 2025 20:43:41 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Put changes to Misc.java in platform-specific blocks test/jdk/java/nio/file/Files/Misc.java line 118: > 116: * Test: Neither file exists > 117: */ > 118: if (Platform.isWindows()) { On second thought, I don't think the sections beginning here, at line 118, and below, at line 139, should differ between Unix and Windows. I think it would be better to change the Windows implementation in the context of this request to return false instead of throwing `IOException`, and investigate any more complicated link checking when addressing https://bugs.openjdk.org/browse/JDK-8365626. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2282840096 From lkorinth at openjdk.org Mon Aug 18 16:34:21 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 16:34:21 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: References: Message-ID: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: after suggestion from Daniel ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/8fa40e7d..286a2cc6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=02-03 Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From lkorinth at openjdk.org Mon Aug 18 16:34:22 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 18 Aug 2025 16:34:22 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: <-1NjyGdZla4kxc5tKPvakW_aqwjNcNXt4ibAf3WndRU=.21ac795a-b7ee-44ac-a155-70e1186c8148@github.com> References: <-1NjyGdZla4kxc5tKPvakW_aqwjNcNXt4ibAf3WndRU=.21ac795a-b7ee-44ac-a155-70e1186c8148@github.com> Message-ID: On Mon, 18 Aug 2025 11:34:39 GMT, Daniel Fuchs wrote: > Hi Leo, I played a bit with your changes and I observed intermittent timeout failures for the following tests: > > ``` > java/net/httpclient/CancelledResponse.java > java/net/httpclient/whitebox/FlowTestDriver.java > ``` > > The first test failing more frequently. Could you please add /timeout=480 to these two tests as well? Fixed! Thanks for helping! ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3197614389 From dfuchs at openjdk.org Mon Aug 18 16:46:13 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 18 Aug 2025 16:46:13 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: On Mon, 18 Aug 2025 16:34:21 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > after suggestion from Daniel Thanks! Changes to JNDI / net / httpclient LGTM. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3197675337 From bpb at openjdk.org Mon Aug 18 21:52:31 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 18 Aug 2025 21:52:31 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v9] In-Reply-To: References: Message-ID: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Improve Unix link handling; return false instead of throwing IOException on Windows ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/8b85dfd7..b2bd8f2f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=07-08 Stats: 88 lines in 3 files changed: 16 ins; 43 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Mon Aug 18 21:52:32 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 18 Aug 2025 21:52:32 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: <-NhcAIuO62gb0PvliVwQNMtHsgsHLcQplbBRf8SpxR0=.c722ee76-69c7-4fd9-8dbe-8231e5411e63@github.com> References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> <-NhcAIuO62gb0PvliVwQNMtHsgsHLcQplbBRf8SpxR0=.c722ee76-69c7-4fd9-8dbe-8231e5411e63@github.com> Message-ID: On Mon, 18 Aug 2025 16:05:18 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 379: >> >>> 377: } >>> 378: return keys; >>> 379: } >> >> I'm a bit puzzled as to why it looks at each element in the path. It should be possible to just enumerate the files of the sym links that exist, something like this >> >> var fileKeys = new HashSet(); >> while (path != null) { >> UnixFileAttributes attrs = UnixFileAttributes.getIfExists(path, false); >> if (attrs != null && attrs.isSymbolicLink()) { >> fileKeys.add(attrs.fileKey()); >> path = (UnixPath) readSymbolicLink(path); >> } else { >> path = null; >> } >> } >> >> >> or better, just return the file key of last accessible link in the chain, something like this, and then just check if they are equal, e.g. >> >> >> private UnixFileKey lastFileKey(UnixPath path) throws UnixException { >> var fileKeys = new HashSet(); >> UnixFileKey lastFileKey = null; >> while (path != null) { >> UnixFileAttributes attrs = UnixFileAttributes.getIfExists(path, false); >> if (attrs == null) { >> break; >> } >> UnixFileKey fileKey = attrs.fileKey(); >> if (!attrs.isSymbolicLink()) { >> return fileKey; >> } >> if (!fileKeys.add(fileKey)) { >> throw new UnixException(ELOOP); >> } >> byte[] target = readlink(path); >> path = new UnixPath(theFileSystem, target); >> } >> return lastFileKey; >> } > >> or better, just return the file key of last accessible link in the chain, something like this, and then just check if they are equal > > Thanks for the suggestion, will investigate. So updated in b2bd8f2. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2283567109 From bpb at openjdk.org Mon Aug 18 21:52:34 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 18 Aug 2025 21:52:34 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> Message-ID: On Mon, 18 Aug 2025 16:09:09 GMT, Brian Burkhalter wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8154364: Put changes to Misc.java in platform-specific blocks > > test/jdk/java/nio/file/Files/Misc.java line 118: > >> 116: * Test: Neither file exists >> 117: */ >> 118: if (Platform.isWindows()) { > > On second thought, I don't think the sections beginning here, at line 118, and below, at line 139, should differ between Unix and Windows. I think it would be better to change the Windows implementation in the context of this request to return false instead of throwing `IOException`, and investigate any more complicated link checking when addressing https://bugs.openjdk.org/browse/JDK-8365626. b2bd8f2 updates the Windows implementation to return `false` instead of throwing an `IOException` in the event either file does not exist. The `Misc` test is updated accordingly, thereby eliminating two platform-specific blocks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2283570390 From bpb at openjdk.org Mon Aug 18 21:56:37 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 18 Aug 2025 21:56:37 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8] In-Reply-To: References: <2vHKLbSpprQMq6c-P7rngt2xhd1H7vbB4oeHB7Nl5tM=.e834525d-0723-4234-9904-4f899d2efa79@github.com> Message-ID: On Sat, 16 Aug 2025 07:04:40 GMT, Alan Bateman wrote: > It would be nice if getIfExists(path) could be implemented as getIfExists(path, true) When I added `getIfExists(UnixPath,boolean)`, I noticed that there was already a degree of inconsistency in that some functions that have native counterparts returning an `int` either also return an `int` or are declared `void`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2283577186 From syan at openjdk.org Tue Aug 19 03:34:47 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 19 Aug 2025 03:34:47 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Mon, 18 Aug 2025 09:15:29 GMT, Leo Korinth wrote: >> It is unclear to me if the author meant this to be `2.5` more than normal or `10` more than JTREG default, or a `multiplier that seems to work`. It does not bother me _more_ if it is a `10` then a `2.5`, as it needs to have a value that is not the multiplicative identity value. I will not change this, the change I have made is already large enough and I want this to be integrated ASAP. > > It is also something that can be changed later, in a follow up fix. Take test test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java as example. If there is a bug in jvm with -Xcomp option which will cause this test run time outed. Before this PR, it will take `7200*10` seconds to run this test finish and report time outed failure. But after this PR, it will take `28800*10` seconds to run this test finish ang then report timed out failure. I think the `28800*10` senonds too long and it's unacceptable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2283972732 From dholmes at openjdk.org Tue Aug 19 05:25:40 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 19 Aug 2025 05:25:40 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 03:31:55 GMT, SendaoYan wrote: >> It is also something that can be changed later, in a follow up fix. > > Take test test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java as example. > If there is a bug in jvm with -Xcomp option which will cause this test run time outed. Before this PR, it will take `7200*10` seconds to run this test finish and report time outed failure. But after this PR, it will take `28800*10` seconds to run this test finish ang then report timed out failure. I think the `28800*10` senonds is too long and it's unacceptable. > It is unclear to me if the author meant this to be 2.5 more than normal or 10 more than JTREG default, or a multiplier that seems to work. What matters is that the actual timeout, in seconds, remains unchanged, so please address this. Timeouts that are excessively long waste machine resources. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2284090715 From dholmes at openjdk.org Tue Aug 19 05:49:44 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 19 Aug 2025 05:49:44 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: On Mon, 18 Aug 2025 16:34:21 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > after suggestion from Daniel By rough count there are 1300 tests that have an explicit timeout set. This change would reduce the actual applied timeout to a quarter of what was previously used, yet you have only had to bump the timeout value for a fraction of the tests - which I find somewhat (pleasantly) surprising. It may be that many of these timeouts stem from a time when we had much much slower machines, so a refresh might not be a bad thing. It will take some time to see the full effects of this change though. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3199288818 From dholmes at openjdk.org Tue Aug 19 06:07:44 2025 From: dholmes at openjdk.org (David Holmes) Date: Tue, 19 Aug 2025 06:07:44 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 05:23:15 GMT, David Holmes wrote: >> Take test test/hotspot/jtreg/compiler/arraycopy/stress/TestStressArrayCopy.java as example. >> If there is a bug in jvm with -Xcomp option which will cause this test run time outed. Before this PR, it will take `7200*10` seconds to run this test finish and report time outed failure. But after this PR, it will take `28800*10` seconds to run this test finish ang then report timed out failure. I think the `28800*10` senonds is too long and it's unacceptable. > > DELETED - I confused the timeout with the timeout-factor. New comment below. No change should be made to any explicit setting of the timeoutFactor in general as that could cause mass timeouts to occur (old default timeout = 120 * 10 = 1200 but new default = 120 * 2.5 = 300!). However I see the concern of @sendaoYan because individual tests may now get much larger timeout values when run with the non-default timeoutFactor because they have been adjusted for the new default. I don't see any solution to this dilemma. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2284161138 From syan at openjdk.org Tue Aug 19 06:40:45 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 19 Aug 2025 06:40:45 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: Message-ID: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> On Tue, 19 Aug 2025 06:04:49 GMT, David Holmes wrote: >> DELETED - I confused the timeout with the timeout-factor. New comment below. > > No change should be made to any explicit setting of the timeoutFactor in general as that could cause mass timeouts to occur (old default timeout = 120 * 10 = 1200 but new default = 120 * 2.5 = 300!). > > However I see the concern of @sendaoYan because individual tests may now get much larger timeout values when run with the non-default timeoutFactor because they have been adjusted for the new default. I don't see any solution to this dilemma. But what this PR do is change the timeoutFactor in general and find out all the tests which may timeout after the timeoutFactor has been changed. The old default timeout before this PR is 120 * 4, after this PR the new default is 120 * 1 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2284273170 From lkorinth at openjdk.org Tue Aug 19 09:02:36 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Tue, 19 Aug 2025 09:02:36 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: On Tue, 19 Aug 2025 05:47:06 GMT, David Holmes wrote: > By rough count there are 1300 tests that have an explicit timeout set. This change would reduce the actual applied timeout to a quarter of what was previously used, yet you have only had to bump the timeout value for a fraction of the tests - which I find somewhat (pleasantly) surprising. It may be that many of these timeouts stem from a time when we had much much slower machines, so a refresh might not be a bad thing. It will take some time to see the full effects of this change though. Thanks David! And as you said, a few more adjustments will probably be needed when we have run this for a while. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3199869795 From lkorinth at openjdk.org Tue Aug 19 09:19:45 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Tue, 19 Aug 2025 09:19:45 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> References: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> Message-ID: On Tue, 19 Aug 2025 06:38:01 GMT, SendaoYan wrote: >> No change should be made to any explicit setting of the timeoutFactor in general as that could cause mass timeouts to occur (old default timeout = 120 * 10 = 1200 but new default = 120 * 2.5 = 300!). >> >> However I see the concern of @sendaoYan because individual tests may now get much larger timeout values when run with the non-default timeoutFactor because they have been adjusted for the new default. I don't see any solution to this dilemma. > > But what this PR do is change the timeoutFactor in general and find out all the tests which may timeout after the timeoutFactor has been changed. > > The old default timeout before this PR is 120 * 4, after this PR the new default is 120 * 1 I do not think 4x longer timeouts for `-Xcomp` is unreasonable. I also do not want to make this huge change even bigger. If you would like to change it after the integration I think that would be valuable --- though my guess is that it could be quite a lot of work. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2284650722 From alanb at openjdk.org Tue Aug 19 10:31:39 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 19 Aug 2025 10:31:39 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v9] In-Reply-To: References: Message-ID: On Mon, 18 Aug 2025 21:52:31 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Improve Unix link handling; return false instead of throwing IOException on Windows src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 117: > 115: } > 116: > 117: return attrs; We can create a follow-up issue to replace this with a version that doesn't use exceptions for control flow, like the 1-arg getIfExists. Then we can change the 1-arg method to use the 2-arg method. src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 393: > 391: attrs2 = UnixFileAttributes.getIfExists(file2); > 392: } catch (UnixException x) { > 393: x.rethrowAsIOException(file1, file2); I think it would be better to handle them separately as that will give a better exception if either fails. With the 2-arg rethrowAsIOException is mostly for move/copy ops. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2284822976 PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2284826790 From alanb at openjdk.org Tue Aug 19 10:45:40 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 19 Aug 2025 10:45:40 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v3] In-Reply-To: References: Message-ID: On Thu, 14 Aug 2025 16:16:17 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8154364: Propagate change of previous commit to Windows > > src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 430: > >> 428: // neither exist and comparison of normalized paths is problematic, >> 429: // so return false >> 430: return false; > > I think you can drop "comparison of normalized paths is problematic" as it begs too many questions for anyone looking at this code. If lastKey is changed to throw when a last file key cannot be obtained then it would simplify the file access in isSameFile to: UnixFileKey key1; try { UnixFileAttributes attrs = UnixFileAttributes.getIfExists(file1); key1 = (attrs != null) ? attrs.fileKey() : lastFileKey(file1); } catch (UnixException e) { e.rethrowAsIOException(file1); return false; } UnixFileKey key2; try { UnixFileAttributes attrs = UnixFileAttributes.getIfExists(file2); key2 = (attrs != null) ? attrs.fileKey() : lastFileKey(file2); } catch (UnixException e) { e.rethrowAsIOException(file2); return false; } return key1.equals(key2); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2284856554 From dclarke at openjdk.org Tue Aug 19 13:18:49 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Tue, 19 Aug 2025 13:18:49 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v2] In-Reply-To: References: Message-ID: > This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. > > These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. > > I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: implementing feedback, adding missing errno checks, cleanup ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25546/files - new: https://git.openjdk.org/jdk/pull/25546/files/4878d558..e2207883 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25546&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25546&range=00-01 Stats: 322 lines in 8 files changed: 168 ins; 135 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/25546.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25546/head:pull/25546 PR: https://git.openjdk.org/jdk/pull/25546 From dclarke at openjdk.org Tue Aug 19 13:22:40 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Tue, 19 Aug 2025 13:22:40 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v2] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 13:18:49 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: > > implementing feedback, adding missing errno checks, cleanup I made a few changes mostly based on comments but I'll give a little patch notes: - I'd missed some errno checks for kqueue - Moved the FFMUtils class from shared to just be in `maxosx`, I also changed how this gets the valueLayouts for C values to match how newer versions of jextract generate this - I changed how the util method that converts errno codes to their respective error strings I ran this against the selector tests on all OSs and everything seems green after repeated tests ------------- PR Comment: https://git.openjdk.org/jdk/pull/25546#issuecomment-3200745633 From rriggs at openjdk.org Tue Aug 19 15:01:40 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 19 Aug 2025 15:01:40 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v4] In-Reply-To: References: Message-ID: <46MfOJA8bICEbZ7EpwzTealkJKqvsxREIKZhsyA-LRE=.295d951f-1eb7-4ad7-9e6a-3f2810c581ce@github.com> On Tue, 12 Aug 2025 19:29:28 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Remove redundant type parameters It seems that the API is overloaded trying to satisfy too many requirements, replace/noreplace, throw/nothrow and supporting arbitrary Charsets. There are multiple callers that only need to create a string from byte array holding latin1. They are burdened with catching and ignoring exceptions that do not occur. I'm suggesting breaking out that use case in PR#https://github.com/openjdk/jdk/pull/26831. That leaves `Files.readString` that needs the full CharSet/noReplace/throw behavior. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26413#issuecomment-3201113471 From bpb at openjdk.org Tue Aug 19 15:35:42 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 19 Aug 2025 15:35:42 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v3] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 10:43:13 GMT, Alan Bateman wrote: > If lastKey is changed to throw when a last file key cannot be obtained This would cause an exception to be thrown instead of returning false. Do we want to do that? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2285637677 From bpb at openjdk.org Tue Aug 19 15:51:37 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 19 Aug 2025 15:51:37 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v9] In-Reply-To: References: Message-ID: <5zuEfV-uPzAwzHRScWeliD0plqbo6JG9pxA0_Ot6ixw=.19e9e1bd-f479-4e6a-bf53-71144e157cb9@github.com> On Tue, 19 Aug 2025 10:27:27 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8154364: Improve Unix link handling; return false instead of throwing IOException on Windows > > src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 117: > >> 115: } >> 116: >> 117: return attrs; > > We can create a follow-up issue to replace this with a version that doesn't use exceptions for control flow, like the 1-arg getIfExists. Then we can change the 1-arg method to use the 2-arg method. Please see [JDK-8365807](https://bugs.openjdk.org/browse/JDK-8365807). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2285678270 From rriggs at openjdk.org Tue Aug 19 16:48:43 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 19 Aug 2025 16:48:43 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v4] In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 19:29:28 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR removes `NoRepl` suffix from method names and consistently uses `throws CCE` in method footprints. (b4845109e18 passes `tier1,2`.) > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Remove redundant type parameters src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 361: > 359: * @throws CharacterCodingException For malformed input or unmappable characters > 360: */ > 361: String newStringUTF8NoReplacement(byte[] bytes, int offset, int length) throws CharacterCodingException; This method is only used by ZipCoder and could be refactored to use `uncheckedNewStringNoReplacement` as in PR#https://github.com/openjdk/jdk/pull/26822. It is a refactoring cleanup not directly related to renaming the NoRepl methods. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2285806922 From duke at openjdk.org Tue Aug 19 17:25:44 2025 From: duke at openjdk.org (ExE Boss) Date: Tue, 19 Aug 2025 17:25:44 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v2] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 13:18:49 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: > > implementing feedback, adding missing errno checks, cleanup src/java.base/macosx/classes/sun/nio/ch/KQueuePoller.java line 50: > 48: "kqueue failed"); > 49: } > 50: this.kqfd = res; Maybe?this duplicated?check should?probably be?moved?into a?common?method in?`KQueue`, like?the?old `KQueue.create()`?method, but?implemented in?**Java**: static int create() throws IOException { int res = kqueue_h.kqueue(); if (res < 0) { throw ErrnoUtils.IOExceptionWithErrnoString(-res, "kqueue failed"); } return res; } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2285879853 From bpb at openjdk.org Tue Aug 19 18:15:02 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 19 Aug 2025 18:15:02 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v10] In-Reply-To: References: Message-ID: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8154364: Suggested change for key comparison ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26736/files - new: https://git.openjdk.org/jdk/pull/26736/files/b2bd8f2f..78f272bb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26736&range=08-09 Stats: 21 lines in 1 file changed: 0 ins; 5 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/26736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26736/head:pull/26736 PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Tue Aug 19 19:49:42 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 19 Aug 2025 19:49:42 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v9] In-Reply-To: References: Message-ID: <4jCjm-Si0lgRpx0tiHCtcU0Ny54kgmhBaasgrR1xw5M=.63675b87-fb8d-4431-b131-e4e78745d189@github.com> On Tue, 19 Aug 2025 10:29:08 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: >> >> 8154364: Improve Unix link handling; return false instead of throwing IOException on Windows > > src/java.base/unix/classes/sun/nio/fs/UnixFileSystemProvider.java line 393: > >> 391: attrs2 = UnixFileAttributes.getIfExists(file2); >> 392: } catch (UnixException x) { >> 393: x.rethrowAsIOException(file1, file2); > > I think it would be better to handle them separately as that will give a better exception if either fails. With the 2-arg rethrowAsIOException is mostly for move/copy ops. Please see 78f272b. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2286179625 From dholmes at openjdk.org Wed Aug 20 12:55:43 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 20 Aug 2025 12:55:43 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> References: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> Message-ID: On Tue, 19 Aug 2025 06:38:01 GMT, SendaoYan wrote: >> No change should be made to any explicit setting of the timeoutFactor in general as that could cause mass timeouts to occur (old default timeout = 120 * 10 = 1200 but new default = 120 * 2.5 = 300!). >> >> However I see the concern of @sendaoYan because individual tests may now get much larger timeout values when run with the non-default timeoutFactor because they have been adjusted for the new default. I don't see any solution to this dilemma. > > But what this PR do is change the timeoutFactor in general and find out all the tests which may timeout after the timeoutFactor has been changed. > > The old default timeout before this PR is 120 * 4, after this PR the new default is 120 * 1 @sendaoYan this PR changes the default timeoutFactor and so also has to change quite a number of implicit and explicit timeouts. But that doesn't mean that test configs that already set their own timeoutFactor should adjust by the same factor! That just doesn't work for any test with an implicit default timeout. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2288072431 From alanb at openjdk.org Wed Aug 20 13:11:42 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 20 Aug 2025 13:11:42 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v10] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 18:15:02 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Suggested change for key comparison Latest implementation changes looks okay. I see there is a follow-up issue created to improve the 2-arg getIfExists. I skimmed over IsSameFile and it looks like good coverage. I don't have cycles to walk through every line right now, hopefully others can help on that. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26736#pullrequestreview-3136528211 From syan at openjdk.org Wed Aug 20 14:28:43 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 20 Aug 2025 14:28:43 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> Message-ID: On Wed, 20 Aug 2025 12:53:23 GMT, David Holmes wrote: >> But what this PR do is change the timeoutFactor in general and find out all the tests which may timeout after the timeoutFactor has been changed. >> >> The old default timeout before this PR is 120 * 4, after this PR the new default is 120 * 1 > > @sendaoYan this PR changes the default timeoutFactor and so also has to change quite a number of implicit and explicit timeouts. But that doesn't mean that test configs that already set their own timeoutFactor should adjust by the same factor! That just doesn't work for any test with an implicit default timeout. Yes, this PR change the default timeoutFactor when the tested JVM options do not contains '-Xcomp', and at the same time also multiplies 4 of the timeout value defined in some tests. So after this PR, the tests which the timeout value has been multiplied 4 will have more timeout value, when the tested [JVM options contains '-Xcomp'](https://github.com/lkorinth/jdk/blob/286a2cc6e989a1c7dcd641bce792c6411bc1d0ea/make/RunTests.gmk#L593). I do agree this change, what I mean is this change has some side effect. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2288361080 From bpb at openjdk.org Wed Aug 20 15:01:39 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 20 Aug 2025 15:01:39 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v10] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 18:15:02 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Suggested change for key comparison > I don't have cycles to walk through every line [of `IsSameFile`] right now, hopefully others can help on that. Thanks for the review. I'll leave this request open for a day or two, meanwhile running tier 1-3 jobs. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26736#issuecomment-3206779212 From ihse at openjdk.org Wed Aug 20 15:19:42 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 20 Aug 2025 15:19:42 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: On Mon, 18 Aug 2025 16:34:21 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > after suggestion from Daniel doc/testing.md line 385: > 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a > 384: certain amount of time will apply this factor. If we run in > 385: forced compilation mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) I don't think there is any point linking to the build source code. Suggestion: certain amount of time will apply this factor. If you run in forced compilation mode (`-Xcomp`) using `make test`, it will automatically adjust this factor to compensate for the interpreter not being as fast as JITed code. Defaults to 1. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2288510800 From ihse at openjdk.org Wed Aug 20 15:24:39 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 20 Aug 2025 15:24:39 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: <8U5zCHQCXe9z3nrLlCwRVgbXCFzWHxqsvI74M1yQ96Y=.4ee013da-22a4-43e3-8660-8bf3c2261450@github.com> On Mon, 18 Aug 2025 16:34:21 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > after suggestion from Daniel It seems to me like there is a need to automatically collect normal test run times automatically, so we can match the timeout given to any individual test with the normal execution time. After all, the purpose of any timeout on tests is to allow the test to execute normally, but not wait too long in case of a problem that causes the test to take too long (or forever) to run. I realize that this is highly hardware dependent, but test times tend to be Pareto distributed, so a very quick test maybe takes 1 second on fast machines and 10 on slow, and very slow tests maybe take 15 minutes on fast machines and 40 minutes on slow. In the first case, anything above 15 seconds is probably sus, and in the second case, anything above 60 is probably not good either (I'm just adding 50% to the max time). Right now it seems engineers is spending their valuable time giving guesstimates for each individual test. That seems like poorly used time and resources. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3206865824 From alanb at openjdk.org Wed Aug 20 15:53:16 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 20 Aug 2025 15:53:16 GMT Subject: RFR: 8364764: java/nio/channels/vthread/BlockingChannelOps.java subtests timed out Message-ID: 4 tests (testSocketChannelWriteAsyncClose, testSocketChannelWriteInterrupt, testPipeWriteAsyncClose testPipeWriteInterrupt) test async close/interrupt when a virtual thread is blocked in write. This is difficult to test as the target thread may wakeup with bytes written (so it returns the number of bytes written rather than throw). The test is changed to "nudge" the writer a few times so that the writer eventually wakes up with no bytes written. Additionally, two tests are added to test async shutdownInput and shutdownOutput. ------------- Commit messages: - More robustness - Merge branch 'master' into JDK-8364764 - Initial commit Changes: https://git.openjdk.org/jdk/pull/26847/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26847&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364764 Stats: 111 lines in 1 file changed: 80 ins; 2 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/26847.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26847/head:pull/26847 PR: https://git.openjdk.org/jdk/pull/26847 From lkorinth at openjdk.org Wed Aug 20 16:27:39 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 20 Aug 2025 16:27:39 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: On Wed, 20 Aug 2025 15:17:02 GMT, Magnus Ihse Bursie wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> after suggestion from Daniel > > doc/testing.md line 385: > >> 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a >> 384: certain amount of time will apply this factor. If we run in >> 385: forced compilation mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) > > I don't think there is any point linking to the build source code. > > Suggestion: > > certain amount of time will apply this factor. If you run in > forced compilation mode (`-Xcomp`) using `make test`, it > will automatically adjust this factor to compensate for the > interpreter not being as fast as JITed code. Defaults to 1. I will remove the link, and I will update my bad text still talking about the interpreter (sorry for that mistake). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2288683592 From lkorinth at openjdk.org Wed Aug 20 17:05:59 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 20 Aug 2025 17:05:59 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: update testing.md, remove makefile link, fix bad text ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/286a2cc6..f24a1e72 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=03-04 Stats: 8 lines in 2 files changed: 0 ins; 2 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From lkorinth at openjdk.org Wed Aug 20 17:05:59 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 20 Aug 2025 17:05:59 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> Message-ID: <2Ba-EiFMVh1-nMHcihw93nZq-TkQNtvHc244Bwe8I40=.cfa54a17-0a3f-465d-a1c3-7560965376d7@github.com> On Wed, 20 Aug 2025 16:24:43 GMT, Leo Korinth wrote: >> doc/testing.md line 385: >> >>> 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a >>> 384: certain amount of time will apply this factor. If we run in >>> 385: forced compilation mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) >> >> I don't think there is any point linking to the build source code. >> >> Suggestion: >> >> certain amount of time will apply this factor. If you run in >> forced compilation mode (`-Xcomp`) using `make test`, it >> will automatically adjust this factor to compensate for the >> interpreter not being as fast as JITed code. Defaults to 1. > > I will remove the link, and I will update my bad text still talking about the interpreter (sorry for that mistake). fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2288793081 From ihse at openjdk.org Wed Aug 20 19:36:44 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 20 Aug 2025 19:36:44 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 17:05:59 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > update testing.md, remove makefile link, fix bad text Build changes look good now. Thanks! ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26749#pullrequestreview-3137980952 From dholmes at openjdk.org Wed Aug 20 21:32:39 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 20 Aug 2025 21:32:39 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: <8U5zCHQCXe9z3nrLlCwRVgbXCFzWHxqsvI74M1yQ96Y=.4ee013da-22a4-43e3-8660-8bf3c2261450@github.com> References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> <8U5zCHQCXe9z3nrLlCwRVgbXCFzWHxqsvI74M1yQ96Y=.4ee013da-22a4-43e3-8660-8bf3c2261450@github.com> Message-ID: On Wed, 20 Aug 2025 15:21:39 GMT, Magnus Ihse Bursie wrote: > I realize that this is highly hardware dependent, but test times tend to be Pareto distributed, so a very quick test maybe takes 1 second on fast machines and 10 on slow, @magicus unfortunately that is often not the case in practice. We can see many tests that normally run very quickly but occasionally run very slow - minutes versus seconds. > Right now it seems engineers is spending their valuable time giving guesstimates for each individual test. That seems like poorly used time and resources. For this exercise existing explicit timeout values need to be multiplied by 4 to keep the same absolute timeout value. In addition a number of tests that use the implicit default timeout (120*4) now need an explicit timeout (480 generally). ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3208143195 From lkorinth at openjdk.org Thu Aug 21 09:12:57 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 21 Aug 2025 09:12:57 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> Message-ID: On Wed, 20 Aug 2025 14:25:57 GMT, SendaoYan wrote: >> @sendaoYan this PR changes the default timeoutFactor and so also has to change quite a number of implicit and explicit timeouts. But that doesn't mean that test configs that already set their own timeoutFactor should adjust by the same factor! That just doesn't work for any test with an implicit default timeout. > > Yes, this PR change the default timeoutFactor when the tested JVM options do not contains '-Xcomp', and at the same time also multiplies 4 of the timeout value defined in some tests. > > So after this PR, the tests which the timeout value has been multiplied 4 will have more timeout value, when the tested [JVM options contains '-Xcomp'](https://github.com/lkorinth/jdk/blob/286a2cc6e989a1c7dcd641bce792c6411bc1d0ea/make/RunTests.gmk#L593). > > I do agree this change, what I mean is this change has some side effect. > >> If you would like to change it after the integration I think that would be valuable --- though my guess is that it could be quite a lot of work. > > I think I can try it in a new PR. I want to _warn_ you before you put too much energy into it. Changing the `-Xcomp` timeout factor might have even bigger impact than my change. Also, I have no idea how well that flag is tested in open testing. That is, your change might look good for you --- but might cause havoc for companies doing more extensive testing. I have still not received green light for integrating my change, because extensive testing is still being run (and other teams are evaluating). I advise against changing the flag. When I evaluate the benefit for the default timeout, it was mainly not the timeout _in itself_ that was the problem, but the fact that most people have no idea that the timeout factor is applied and thus can not create or debug tests in a good way. I hope this helps you, and does not come out as too negative. I just feel that I have put too much energy into this, and I do not hope that struggle for you. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2290422272 From vyazici at openjdk.org Thu Aug 21 09:39:44 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 21 Aug 2025 09:39:44 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - Javadoc fix - Cosmetic improvements - Merge remote-tracking branch 'upstream/master' into jlaNoRepl - Remove redundant type parameters - Simplify added null checks - Avoid code duplication by sprinkling some generics magic - Group `String` methods by `doReplace` argument - Merge remote-tracking branch 'upstream/master' into jlaNoRepl - Replace `requireNonNull` with implicit null checks - Merge remote-tracking branch 'upstream/master' into jlaNoRepl - ... and 3 more: https://git.openjdk.org/jdk/compare/a7c0f4b8...7af0f351 ------------- Changes: https://git.openjdk.org/jdk/pull/26413/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=04 Stats: 217 lines in 7 files changed: 77 ins; 39 del; 101 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Thu Aug 21 09:39:46 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 21 Aug 2025 09:39:46 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v4] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 16:45:42 GMT, Roger Riggs wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove redundant type parameters > > src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 361: > >> 359: * @throws CharacterCodingException For malformed input or unmappable characters >> 360: */ >> 361: String newStringUTF8NoReplacement(byte[] bytes, int offset, int length) throws CharacterCodingException; > > This method is only used by ZipCoder and could be refactored to use `uncheckedNewStringNoReplacement` as in PR#https://github.com/openjdk/jdk/pull/26822. > It is a refactoring cleanup not directly related to renaming the NoRepl methods. Thanks so much for the donation! Picked up #26831 and #26822 changes in the f753389 merge commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2290474619 From syan at openjdk.org Thu Aug 21 09:52:54 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 21 Aug 2025 09:52:54 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v3] In-Reply-To: References: <5YehMZKBa60PIk9Ia2sC4kLuFx5ZvfmtoYT_H-LuQbM=.e40c421f-d2af-46e5-8dc7-5b30fe79c0b0@github.com> Message-ID: On Thu, 21 Aug 2025 09:10:26 GMT, Leo Korinth wrote: >> Yes, this PR change the default timeoutFactor when the tested JVM options do not contains '-Xcomp', and at the same time also multiplies 4 of the timeout value defined in some tests. >> >> So after this PR, the tests which the timeout value has been multiplied 4 will have more timeout value, when the tested [JVM options contains '-Xcomp'](https://github.com/lkorinth/jdk/blob/286a2cc6e989a1c7dcd641bce792c6411bc1d0ea/make/RunTests.gmk#L593). >> >> I do agree this change, what I mean is this change has some side effect. >> >>> If you would like to change it after the integration I think that would be valuable --- though my guess is that it could be quite a lot of work. >> >> I think I can try it in a new PR. > > I want to _warn_ you before you put too much energy into it. Changing the `-Xcomp` timeout factor might have even bigger impact than my change. Also, I have no idea how well that flag is tested in open testing. That is, your change might look good for you --- but might cause havoc for companies doing more extensive testing. > > I have still not received green light for integrating my change, because extensive testing is still being run (and other teams are evaluating). I advise against changing the flag. When I evaluate the benefit for the default timeout, it was mainly not the timeout _in itself_ that was the problem, but the fact that most people have no idea that the timeout factor is applied and thus can not create or debug tests in a good way. I hope this helps you, and does not come out as too negative. I just feel that I have put too much energy into this, and I do not hope that struggle for you. @lkorinth Thanks for your advice sincerely. I think you are right, we need more evaluate cautiously before start to change the timeoutFactor for -Xcomp. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2290523415 From ihse at openjdk.org Thu Aug 21 12:21:00 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 21 Aug 2025 12:21:00 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v4] In-Reply-To: <8U5zCHQCXe9z3nrLlCwRVgbXCFzWHxqsvI74M1yQ96Y=.4ee013da-22a4-43e3-8660-8bf3c2261450@github.com> References: <0EoWHaPUvqZvxYNRoBbcFdHS9QVXCnfHQqPyd4srQlc=.cfd617e9-5be4-4c14-bf71-68a73d86836b@github.com> <8U5zCHQCXe9z3nrLlCwRVgbXCFzWHxqsvI74M1yQ96Y=.4ee013da-22a4-43e3-8660-8bf3c2261450@github.com> Message-ID: On Wed, 20 Aug 2025 15:21:39 GMT, Magnus Ihse Bursie wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> after suggestion from Daniel > > It seems to me like there is a need to automatically collect normal test run times automatically, so we can match the timeout given to any individual test with the normal execution time. After all, the purpose of any timeout on tests is to allow the test to execute normally, but not wait too long in case of a problem that causes the test to take too long (or forever) to run. > > I realize that this is highly hardware dependent, but test times tend to be Pareto distributed, so a very quick test maybe takes 1 second on fast machines and 10 on slow, and very slow tests maybe take 15 minutes on fast machines and 40 minutes on slow. In the first case, anything above 15 seconds is probably sus, and in the second case, anything above 60 is probably not good either (I'm just adding 50% to the max time). > > Right now it seems engineers is spending their valuable time giving guesstimates for each individual test. That seems like poorly used time and resources. > @magicus unfortunately that is often not the case in practice. We can see many tests that normally run very quickly but occasionally run very slow - minutes versus seconds. That is surprising and a bit disappointing. I guess it is not worth the effort to try and figure out why this is the case; it could probably vary from test to test and be difficult to track for little gain. Still, it makes you wonder. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3210365303 From liach at openjdk.org Thu Aug 21 13:39:55 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 21 Aug 2025 13:39:55 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 09:39:44 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: > > - Javadoc fix > - Cosmetic improvements > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Remove redundant type parameters > - Simplify added null checks > - Avoid code duplication by sprinkling some generics magic > - Group `String` methods by `doReplace` argument > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Replace `requireNonNull` with implicit null checks > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - ... and 3 more: https://git.openjdk.org/jdk/compare/a7c0f4b8...7af0f351 src/java.base/share/classes/java/lang/String.java line 1319: > 1317: } > 1318: > 1319: private static E malformedInputException(byte[] val, Class exceptionType) { This one seems only meaningful for ascii. Should we rename this to maybe `malformedAscii`? test/jdk/java/lang/String/NoReplTest.java line 1: > 1: /* Should we rename this to `NoReplacementTest`? test/jdk/java/lang/String/NoReplTest.java line 2: > 1: /* > 2: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. Suggestion: * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291038173 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291091134 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291091448 From rriggs at openjdk.org Thu Aug 21 13:43:02 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 21 Aug 2025 13:43:02 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 09:39:44 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: > > - Javadoc fix > - Cosmetic improvements > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Remove redundant type parameters > - Simplify added null checks > - Avoid code duplication by sprinkling some generics magic > - Group `String` methods by `doReplace` argument > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - Replace `requireNonNull` with implicit null checks > - Merge remote-tracking branch 'upstream/master' into jlaNoRepl > - ... and 3 more: https://git.openjdk.org/jdk/compare/a7c0f4b8...7af0f351 src/java.base/share/classes/java/lang/String.java line 890: > 888: > 889: private static byte[] encodeWithEncoder( > 890: Charset cs, byte coder, byte[] val, Class characterCodingException) The argument name `characterCodingException` reads more like an exception instance than an exception Class. In this use, it is referring to a class, an instance of which will be thrown. It could be just `exceptionClass`. src/java.base/share/classes/java/lang/String.java line 891: > 889: private static byte[] encodeWithEncoder( > 890: Charset cs, byte coder, byte[] val, Class characterCodingException) > 891: throws E { This is a very curious construct; clever in a way but also a bit magical. All the while enabling the caller (using null) to avoid having to declare the exception. If there were a concise explanation, that might be useful to future maintainers. src/java.base/share/classes/java/lang/String.java line 964: > 962: /** > 963: * {@return the sequence of bytes obtained by encoding the given string in > 964: * the specified {@linkplain java.nio.charset.Charset charset}} Omit the link, for this private use, just say `Charset`. src/java.base/share/classes/java/lang/String.java line 1169: > 1167: > 1168: private static int decodeUTF8_UTF16( > 1169: byte[] src, int sp, int sl, byte[] dst, int dp, Class malformedInputException) Ditto comment about argument `malformedInputException` as an instance vs a class of exception, an instance of which will be thrown. src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 349: > 347: /** > 348: * {@return the sequence of bytes obtained by encoding the given string in > 349: * the specified {@linkplain java.nio.charset.Charset charset}} (ok, not public javadoc) But Links in the Title line of a method are discouraged since they end up in multiple places. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291092201 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291070853 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291083898 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291096063 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291055185 From liach at openjdk.org Thu Aug 21 13:49:55 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 21 Aug 2025 13:49:55 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 13:29:06 GMT, Roger Riggs wrote: >> Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: >> >> - Javadoc fix >> - Cosmetic improvements >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Remove redundant type parameters >> - Simplify added null checks >> - Avoid code duplication by sprinkling some generics magic >> - Group `String` methods by `doReplace` argument >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Replace `requireNonNull` with implicit null checks >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - ... and 3 more: https://git.openjdk.org/jdk/compare/a7c0f4b8...7af0f351 > > src/java.base/share/classes/java/lang/String.java line 891: > >> 889: private static byte[] encodeWithEncoder( >> 890: Charset cs, byte coder, byte[] val, Class characterCodingException) >> 891: throws E { > > This is a very curious construct; clever in a way but also a bit magical. > All the while enabling the caller (using null) to avoid having to declare the exception. > If there were a concise explanation, that might be useful to future maintainers. Indeed, this uses the well-known Java 8 sneaky throws trick. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2291128513 From bpb at openjdk.org Thu Aug 21 20:00:59 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 21 Aug 2025 20:00:59 GMT Subject: RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v10] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 18:15:02 GMT, Brian Burkhalter wrote: >> This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8154364: Suggested change for key comparison Tier 1-3 jobs passed on the usual platforms. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26736#issuecomment-3211900842 From bpb at openjdk.org Thu Aug 21 20:01:00 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 21 Aug 2025 20:01:00 GMT Subject: Integrated: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 01:15:35 GMT, Brian Burkhalter wrote: > This request proposes to broaden the definition of which paths are considered to be the same by `java.nio.file.Files.isSameFile()`. A new test is added to cover many comparisons. This pull request has now been integrated. Changeset: 52747256 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/52747256bbd5490dba9ef9832025a0f7057e338f Stats: 566 lines in 5 files changed: 526 ins; 17 del; 23 mod 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links Reviewed-by: alanb ------------- PR: https://git.openjdk.org/jdk/pull/26736 From bpb at openjdk.org Thu Aug 21 22:09:27 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 21 Aug 2025 22:09:27 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow Message-ID: In the Unix implementation of `sun.nio.fs`, change 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. ------------- Commit messages: - 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow Changes: https://git.openjdk.org/jdk/pull/26889/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365807 Stats: 39 lines in 3 files changed: 7 ins; 13 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/26889.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26889/head:pull/26889 PR: https://git.openjdk.org/jdk/pull/26889 From prr at openjdk.org Fri Aug 22 05:54:55 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 22 Aug 2025 05:54:55 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 17:05:59 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > update testing.md, remove makefile link, fix bad text test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java line 50: > 48: * @summary URL.getContent() should return SoundClip for supported formats > 49: * @run main/othervm/timeout=480 -Xmx128m AudioContentHandlers > 50: */ I've looked at our CI and this test has run 80,000 times and only 10 of those have gone > 120 seconds (and only 2 > 145 seconds) Perhaps I'd see similar for other tests. But I need to hear test-specific reasons for the test-specific boost of 4x from what I think (120) is the default to 480. Otherwise I'd prefer no change, or a small change, by maybe 1.5x not 4x, and we'll adjust the test when we see evidence that it is not enough. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2292765283 From dholmes at openjdk.org Fri Aug 22 06:38:56 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 22 Aug 2025 06:38:56 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 05:51:38 GMT, Phil Race wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java line 50: > >> 48: * @summary URL.getContent() should return SoundClip for supported formats >> 49: * @run main/othervm/timeout=480 -Xmx128m AudioContentHandlers >> 50: */ > > I've looked at our CI and this test has run 80,000 times and only 10 of those have gone > 120 seconds (and only 2 > 145 seconds) > Perhaps I'd see similar for other tests. But I need to hear test-specific reasons for the test-specific boost of 4x from what I think (120) is the default to 480. > Otherwise I'd prefer no change, or a small change, by maybe 1.5x not 4x, and we'll adjust the test when we see evidence that it is not enough. @prrace the change maintains the same absolute timeout value for those tests. Before the default of 120 was multiplied by the timeoutFactor of 4 to given 480. Now the value 480 is multiplied by the timeoutFactor of 1 to give 480. And IIRC Leo only did that for tests that demonstrated a timeout with the new default settings (120*1). It is not practical for Leo to investigate every changed test to see if it could get away with a value between 120 and 480. The change just maintains the status quo. Test owners are free to investigate further if they think it worth fine tuning these values. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2292836043 From jpai at openjdk.org Fri Aug 22 06:55:54 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Fri, 22 Aug 2025 06:55:54 GMT Subject: RFR: 8364764: java/nio/channels/vthread/BlockingChannelOps.java subtests timed out In-Reply-To: References: Message-ID: <3lQoamI3Og3-HFQbVspxX1t9kBED-8HMUgXampIhwQI=.072e916b-cd9e-49fc-a740-bf42dc563223@github.com> On Tue, 19 Aug 2025 17:58:12 GMT, Alan Bateman wrote: > 4 tests (testSocketChannelWriteAsyncClose, testSocketChannelWriteInterrupt, testPipeWriteAsyncClose testPipeWriteInterrupt) test async close/interrupt when a virtual thread is blocked in write. This is difficult to test as the target thread may wakeup with bytes written (so it returns the number of bytes written rather than throw). The test is changed to "nudge" the writer a few times so that the writer eventually wakes up with no bytes written. > > Additionally, two tests are added to test async shutdownInput and shutdownOutput. This looks OK to me. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26847#pullrequestreview-3143304062 From alanb at openjdk.org Fri Aug 22 08:19:56 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 22 Aug 2025 08:19:56 GMT Subject: Integrated: 8364764: java/nio/channels/vthread/BlockingChannelOps.java subtests timed out In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 17:58:12 GMT, Alan Bateman wrote: > 4 tests (testSocketChannelWriteAsyncClose, testSocketChannelWriteInterrupt, testPipeWriteAsyncClose testPipeWriteInterrupt) test async close/interrupt when a virtual thread is blocked in write. This is difficult to test as the target thread may wakeup with bytes written (so it returns the number of bytes written rather than throw). The test is changed to "nudge" the writer a few times so that the writer eventually wakes up with no bytes written. > > Additionally, two tests are added to test async shutdownInput and shutdownOutput. This pull request has now been integrated. Changeset: f0498c2a Author: Alan Bateman URL: https://git.openjdk.org/jdk/commit/f0498c2aed761d4023917bc9cd1f852a02ce977a Stats: 111 lines in 1 file changed: 80 ins; 2 del; 29 mod 8364764: java/nio/channels/vthread/BlockingChannelOps.java subtests timed out Reviewed-by: jpai ------------- PR: https://git.openjdk.org/jdk/pull/26847 From alanb at openjdk.org Fri Aug 22 09:42:56 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 22 Aug 2025 09:42:56 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 22:03:40 GMT, Brian Burkhalter wrote: > In the Unix implementation of `sun.nio.fs`, change > > 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and > 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 122: > 120: UnixFileAttributes attrs = new UnixFileAttributes(); > 121: int flag = (followLinks) ? 0 : UnixConstants.AT_SYMLINK_NOFOLLOW; > 122: UnixNativeDispatcher.fstatat(dfd, path, flag, attrs); If dfd/path does not exist then won't this now return an unpopulated UnixFileAttributes? I think my concern is that the changes create a bit of a hazard. Most UnixNativeDispatcher native methods throw if the syscall fails, a small number return the errno, now we have a native method that special cases ENOENT. I think we should try to limit it to two variants, one that throws, the other that returns errno, and establish some naming convention to reduce the possibility of mis-use. It would be good to audit out tests to make sure that every method exercises error cases. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26889#discussion_r2293236377 From vyazici at openjdk.org Fri Aug 22 13:26:37 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 22 Aug 2025 13:26:37 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v6] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision: - Renamed to `malformedASCII` - Improve exception parametrization - Document parametrization on the exception type - Avoid using links in the Javadoc title line - Rename `NoReplTest` and fix its copyright year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/7af0f351..a73b446a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=04-05 Stats: 54 lines in 3 files changed: 10 ins; 0 del; 44 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Fri Aug 22 13:26:40 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 22 Aug 2025 13:26:40 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 13:37:20 GMT, Roger Riggs wrote: >> Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: >> >> - Javadoc fix >> - Cosmetic improvements >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Remove redundant type parameters >> - Simplify added null checks >> - Avoid code duplication by sprinkling some generics magic >> - Group `String` methods by `doReplace` argument >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Replace `requireNonNull` with implicit null checks >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - ... and 3 more: https://git.openjdk.org/jdk/compare/a7c0f4b8...7af0f351 > > src/java.base/share/classes/java/lang/String.java line 890: > >> 888: >> 889: private static byte[] encodeWithEncoder( >> 890: Charset cs, byte coder, byte[] val, Class characterCodingException) > > The argument name `characterCodingException` reads more like an exception instance than an exception Class. > In this use, it is referring to a class, an instance of which will be thrown. It could be just `exceptionClass`. Renamed in 09b8f508cfa. > src/java.base/share/classes/java/lang/String.java line 964: > >> 962: /** >> 963: * {@return the sequence of bytes obtained by encoding the given string in >> 964: * the specified {@linkplain java.nio.charset.Charset charset}} > > Omit the link, for this private use, just say `Charset`. See my earlier comment ? fixed in 01d4f878b4d. > src/java.base/share/classes/java/lang/String.java line 1169: > >> 1167: >> 1168: private static int decodeUTF8_UTF16( >> 1169: byte[] src, int sp, int sl, byte[] dst, int dp, Class malformedInputException) > > Ditto comment about argument `malformedInputException` as an instance vs a class of exception, an instance of which will be thrown. Renamed in 09b8f508cfa. > src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 349: > >> 347: /** >> 348: * {@return the sequence of bytes obtained by encoding the given string in >> 349: * the specified {@linkplain java.nio.charset.Charset charset}} > > (ok, not public javadoc) > But Links in the Title line of a method are discouraged since they end up in multiple places. Pushed 01d4f878b4d correcting it in certain `JavaLangAccess` and `String` parts where this PR touches ? I've left other occurrences as is. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293730565 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293730280 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293730980 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293727839 From vyazici at openjdk.org Fri Aug 22 13:26:40 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 22 Aug 2025 13:26:40 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 13:47:03 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/String.java line 891: >> >>> 889: private static byte[] encodeWithEncoder( >>> 890: Charset cs, byte coder, byte[] val, Class characterCodingException) >>> 891: throws E { >> >> This is a very curious construct; clever in a way but also a bit magical. >> All the while enabling the caller (using null) to avoid having to declare the exception. >> If there were a concise explanation, that might be useful to future maintainers. > > Indeed, this uses the well-known Java 8 sneaky throws trick. Totally agreed ? documented exception parametrization in 87f831e1c50. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293730019 From vyazici at openjdk.org Fri Aug 22 13:26:41 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 22 Aug 2025 13:26:41 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5] In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 13:17:13 GMT, Chen Liang wrote: >> Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: >> >> - Javadoc fix >> - Cosmetic improvements >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Remove redundant type parameters >> - Simplify added null checks >> - Avoid code duplication by sprinkling some generics magic >> - Group `String` methods by `doReplace` argument >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - Replace `requireNonNull` with implicit null checks >> - Merge remote-tracking branch 'upstream/master' into jlaNoRepl >> - ... and 3 more: https://git.openjdk.org/jdk/compare/a7c0f4b8...7af0f351 > > src/java.base/share/classes/java/lang/String.java line 1319: > >> 1317: } >> 1318: >> 1319: private static E malformedInputException(byte[] val, Class exceptionType) { > > This one seems only meaningful for ascii. Should we rename this to maybe `malformedAscii`? Renamed in a73b446a290. > test/jdk/java/lang/String/NoReplTest.java line 1: > >> 1: /* > > Should we rename this to `NoReplacementTest`? Renamed in 17196765c99. > test/jdk/java/lang/String/NoReplTest.java line 2: > >> 1: /* >> 2: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. > > Suggestion: > > * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. Fixed in 17196765c99. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293719199 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293719925 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293720263 From syan at openjdk.org Fri Aug 22 13:36:38 2025 From: syan at openjdk.org (SendaoYan) Date: Fri, 22 Aug 2025 13:36:38 GMT Subject: RFR: 8365983: Tests should throw SkippedException when SCTP not supported Message-ID: Currently, take test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java as example. When Util.isSCTPSupported() return false, then test print a warning and the exit. I think it's better to throw jtreg.SkippedException rather than only print a warning and then report test passed. Change has been verified locally, test-fix only, almost no risk. ------------- Commit messages: - 8365983: Tests should throw SkippedException when SCTP not supported Changes: https://git.openjdk.org/jdk/pull/26903/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26903&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365983 Stats: 207 lines in 15 files changed: 101 ins; 89 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/26903.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26903/head:pull/26903 PR: https://git.openjdk.org/jdk/pull/26903 From duke at openjdk.org Fri Aug 22 13:36:38 2025 From: duke at openjdk.org (Francesco Andreuzzi) Date: Fri, 22 Aug 2025 13:36:38 GMT Subject: RFR: 8365983: Tests should throw SkippedException when SCTP not supported In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 13:30:19 GMT, SendaoYan wrote: > Currently, take test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java as example. When Util.isSCTPSupported() return false, then test print a warning and the exit. > > I think it's better to throw jtreg.SkippedException rather than only print a warning and then report test passed. > > Change has been verified locally, test-fix only, almost no risk. test/jdk/com/sun/nio/sctp/SctpChannel/Bind.java line 342: > 340: public static void main(String[] args) throws Throwable { > 341: if (!Util.isSCTPSupported()) { > 342: throw new jtreg.SkippedException("SCTP protocol is not supported"); Why do you need to qualify the name with `jtreg.`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26903#discussion_r2293755627 From vyazici at openjdk.org Fri Aug 22 13:40:53 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 22 Aug 2025 13:40:53 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v6] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 13:26:37 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision: > > - Renamed to `malformedASCII` > - Improve exception parametrization > - Document parametrization on the exception type > - Avoid using links in the Javadoc title line > - Rename `NoReplTest` and fix its copyright year src/java.base/share/classes/java/lang/String.java line 892: > 890: Charset cs, byte coder, byte[] val, Class exceptionClass) > 891: // Parametrizing on exception type to enable callers (using null) to avoid having to declare the exception > 892: throws E { @RogerRiggs, since there is nothing stopping the programmer from passing `TotallyUnrelatedException.class` to `encodeWithEncoder()` (or to 2 other sneakily throwing methods), I've tried adding the following as the first thing in this methods' body: assert exceptionClass == null || CharacterCodingException.class.isAssignableFrom(exceptionClass); This beautifully caused a JVM crash due to early initialization issues surrounding `String`. @liach suggested the following: 1. Move assertions to `StringLatin1` and `StringUTF16` ? This solves the issue, but the check is at a relatively later stage. 2. Replace `assert` with a runtime check, e.g., `if (...) { throw new AssertionError(...); }` ? This solves the issue, but incurs a runtime penalty What would you advice? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293767452 From rriggs at openjdk.org Fri Aug 22 14:41:54 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 22 Aug 2025 14:41:54 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v6] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 13:26:37 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision: > > - Renamed to `malformedASCII` > - Improve exception parametrization > - Document parametrization on the exception type > - Avoid using links in the Javadoc title line > - Rename `NoReplTest` and fix its copyright year Thanks for the updates. src/java.base/share/classes/java/lang/String.java line 1316: > 1314: > 1315: @SuppressWarnings("unchecked") > 1316: private static E malformedInputException(int off, int nb, Class exceptionClass) { The argument name can be "_", since it is ignored and is unused in the body. Comment the method as always throwing MalformedInputException. Similarly in the other malformedInput methods*. ------------- PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3144650993 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293885424 From rriggs at openjdk.org Fri Aug 22 14:41:56 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 22 Aug 2025 14:41:56 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v6] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 13:38:24 GMT, Volkan Yazici wrote: >> Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision: >> >> - Renamed to `malformedASCII` >> - Improve exception parametrization >> - Document parametrization on the exception type >> - Avoid using links in the Javadoc title line >> - Rename `NoReplTest` and fix its copyright year > > src/java.base/share/classes/java/lang/String.java line 892: > >> 890: Charset cs, byte coder, byte[] val, Class exceptionClass) >> 891: // Parametrizing on exception type to enable callers (using null) to avoid having to declare the exception >> 892: throws E { > > @RogerRiggs, since there is nothing stopping the programmer from passing `TotallyUnrelatedException.class` to `encodeWithEncoder()` (or to 2 other sneakily throwing methods), I've tried adding the following as the first thing in this methods' body: > > assert exceptionClass == null || CharacterCodingException.class.isAssignableFrom(exceptionClass); > > This beautifully caused a JVM crash due to early initialization issues surrounding `String`. @liach suggested the following: > > 1. Move assertions to `StringLatin1` and `StringUTF16` ? This solves the issue, but the check is at a relatively later stage. > 2. Replace `assert` with a runtime check, e.g., `if (...) { throw new AssertionError(...); }` ? This solves the issue, but incurs a runtime penalty > > What would you advice? "the programmer" is an OpenJDK developer and won't be making spurious changes. The exception classes are only present to make the compiler satisfied, they are ignored at the point the exceptions are thrown. A mismatch in the exception class would show up at compile time, not matching the signature of the calling method. And they are buried in the implementation under the `decodeUTF8_UTF16` and `decodeUTF8_UTF16NoReplacement` wrappers. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293839186 From bpb at openjdk.org Fri Aug 22 15:12:51 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 22 Aug 2025 15:12:51 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 09:40:26 GMT, Alan Bateman wrote: >> In the Unix implementation of `sun.nio.fs`, change >> >> 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and >> 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. > > src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 122: > >> 120: UnixFileAttributes attrs = new UnixFileAttributes(); >> 121: int flag = (followLinks) ? 0 : UnixConstants.AT_SYMLINK_NOFOLLOW; >> 122: UnixNativeDispatcher.fstatat(dfd, path, flag, attrs); > > If dfd/path does not exist then won't this now return an unpopulated UnixFileAttributes? > > I think my concern is that the changes create a bit of a hazard. Most UnixNativeDispatcher native methods throw if the syscall fails, a small number return the errno, now we have a native method that special cases ENOENT. I think we should try to limit it to two variants, one that throws, the other that returns errno, and establish some naming convention to reduce the possibility of mis-use. It would be good to audit out tests to make sure that every method exercises error cases. This change was intended to address [this comment](https://github.com/openjdk/jdk/pull/26736#pullrequestreview-3131687830) a version that doesn't use exceptions for control flow, but I think I misinterpreted that. I'll reassess the change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26889#discussion_r2294004383 From ayang at openjdk.org Fri Aug 22 16:10:58 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 22 Aug 2025 16:10:58 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 17:05:59 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > update testing.md, remove makefile link, fix bad text > Before the default of 120 was multiplied by the timeoutFactor of 4 to given 480. Now the value 480 is multiplied by the timeoutFactor of 1 to give 480. I identified some cases that doesn't follow this. Unclear whether they are intentional. test/hotspot/jtreg/compiler/tiered/Level2RecompilationTest.java line 36: > 34: * @build jdk.test.whitebox.WhiteBox > 35: * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox > 36: * @run main/othervm/timeout=960 -Xbootclasspath/a:. -XX:+TieredCompilation Why not `480` in this case? test/hotspot/jtreg/runtime/cds/appcds/LotsOfSyntheticClasses.java line 40: > 38: * @requires vm.cds > 39: * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds > 40: * @run driver/timeout=8000 LotsOfSyntheticClasses I was expecting `500 * 4 = 2000`, instead of `8000` here. test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendResume2/SuspendResume2.java line 31: > 29: * @compile SuspendResume2.java > 30: * @run driver jdk.test.lib.FileInstaller . . > 31: * @run main/othervm/native/timeout=700 Why `700` instead of `480` in this file? test/jdk/java/rmi/transport/dgcDeadLock/DGCDeadLock.java line 59: > 57: public class DGCDeadLock implements Runnable { > 58: final static public int HOLD_TARGET_TIME = 25000; > 59: public static final double TEST_FAIL_TIME = (HOLD_TARGET_TIME + 30000) * Math.max(TestLibrary.getTimeoutFactor(), 4); Why `max(...)`? If it's for backwards compatibility, shouldn't it be `(HOLD_TARGET_TIME + 30000) * 4 * TestLibrary.getTimeoutFactor()`? test/jdk/java/util/HashMap/WhiteBoxResizeTest.java line 60: > 58: * @comment skip running this test on 32 bit VM > 59: * @requires vm.bits == "64" > 60: * @run testng/othervm/timeout=960 -Xmx2g WhiteBoxResizeTest Why not `480`? test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.java line 34: > 32: * @build com.foobar.Utils > 33: * com.bar.* > 34: * @run junit/othervm/timeout=960 -Djava.locale.providers=CLDR,SPI LocaleNameProviderTest Why not `480`? test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java line 49: > 47: * @library /test/lib /test/jdk > 48: * @modules jdk.jfr/jdk.jfr.internal.test > 49: * @run main/othervm/timeout=960 -XX:TLABSize=2k jdk.jfr.event.oldobject.TestObjectDescription Why not `480`? test/jdk/tools/jpackage/share/InstallDirTest.java line 69: > 67: * @compile -Xlint:all -Werror InstallDirTest.java > 68: * @requires (jpackage.test.SQETest != null) > 69: * @run main/othervm/timeout=4000 -Xmx512m jdk.jpackage.test.Main Why more than `4x` in this file? test/langtools/jdk/jshell/HangingRemoteAgent.java line 38: > 36: class HangingRemoteAgent extends RemoteExecutionControl { > 37: > 38: private static final int TIMEOUT = (int)(2000 * Double.parseDouble(System.getProperty("test.timeout.factor", "1.0"))); why not `Utils.TIMEOUT_FACTOR`? test/langtools/jdk/jshell/UITesting.java line 148: > 146: } > 147: > 148: private static final long TIMEOUT = (long) (60_000 * Double.parseDouble(System.getProperty("test.timeout.factor", "1.0"))); Why not `Utils.TIMEOUT_FACTOR`? ------------- PR Review: https://git.openjdk.org/jdk/pull/26749#pullrequestreview-3144985957 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294077875 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294085201 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294089550 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294108202 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294110136 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294113670 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294116148 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294119800 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294128741 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294129243 From bpb at openjdk.org Fri Aug 22 16:27:08 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 22 Aug 2025 16:27:08 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: > In the Unix implementation of `sun.nio.fs`, change > > 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and > 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8365807: Make all [f]stat*0 functions void; remove stat2 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26889/files - new: https://git.openjdk.org/jdk/pull/26889/files/a4545b9f..7ea1b084 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=00-01 Stats: 37 lines in 3 files changed: 1 ins; 17 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/26889.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26889/head:pull/26889 PR: https://git.openjdk.org/jdk/pull/26889 From bpb at openjdk.org Fri Aug 22 16:29:53 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 22 Aug 2025 16:29:53 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 15:10:15 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 122: >> >>> 120: UnixFileAttributes attrs = new UnixFileAttributes(); >>> 121: int flag = (followLinks) ? 0 : UnixConstants.AT_SYMLINK_NOFOLLOW; >>> 122: UnixNativeDispatcher.fstatat(dfd, path, flag, attrs); >> >> If dfd/path does not exist then won't this now return an unpopulated UnixFileAttributes? >> >> I think my concern is that the changes create a bit of a hazard. Most UnixNativeDispatcher native methods throw if the syscall fails, a small number return the errno, now we have a native method that special cases ENOENT. I think we should try to limit it to two variants, one that throws, the other that returns errno, and establish some naming convention to reduce the possibility of mis-use. It would be good to audit out tests to make sure that every method exercises error cases. > > This change was intended to address [this comment](https://github.com/openjdk/jdk/pull/26736#pullrequestreview-3131687830) > > a version that doesn't use exceptions for control flow, > > but I think I misinterpreted that. I'll reassess the change. Commit 7ea1b08: 1. Change `fstatat0` and `stat0` to throw instead of returning `errno`. 2. Remove the `stat2` method. 3. Change calling code to handle the changes. Now all `?stat{at}0` functions are void, expressing errors via `UnixException`. All `UnixNativeDispatcher` methods are now `void` except: jbytearray getcwd, getgrid, getgrnam, getpwnam, getpwuid, readdir, realpath, strerror jint access, dup, fgetxattr, flistxattr, getlinelen, openat, read, write jlong fdopendir, opendir All these functions return a "useful" value, except `access` which returns `errno`. It would be a little disruptive to change `access` to throw instead of returning `errno` as there are a number of usages like return access(path, mode) == 0; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26889#discussion_r2294168512 From alanb at openjdk.org Fri Aug 22 16:47:55 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 22 Aug 2025 16:47:55 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 16:27:08 GMT, Brian Burkhalter wrote: >> In the Unix implementation of `sun.nio.fs`, change >> >> 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and >> 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8365807: Make all [f]stat*0 functions void; remove stat2 UnixFileAttributes.getIfExists is performance critical so this is why it the native method returns errno rather than throws. The suggestion is the new 2-arg getIfExits work the same way and only throw if the error is not ENOENT. My comment on void vs. int return is to point out the hazard when we have two styles, it's too easy to call the method that does not throw when an exception is expected. This lead to the suggestion to choose a naming convention to avoid mistakes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26889#issuecomment-3214988601 From bpb at openjdk.org Fri Aug 22 16:53:52 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Fri, 22 Aug 2025 16:53:52 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 16:45:26 GMT, Alan Bateman wrote: > UnixFileAttributes.getIfExists is performance critical so this is why it the native method returns errno rather than throws. So the `stat0` and `fstatat0` methods should revert to returning `errno`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26889#issuecomment-3215001314 From prr at openjdk.org Fri Aug 22 17:20:57 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 22 Aug 2025 17:20:57 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 05:51:38 GMT, Phil Race wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java line 50: > >> 48: * @summary URL.getContent() should return SoundClip for supported formats >> 49: * @run main/othervm/timeout=480 -Xmx128m AudioContentHandlers >> 50: */ > > I've looked at our CI and this test has run 80,000 times and only 10 of those have gone > 120 seconds (and only 2 > 145 seconds) > Perhaps I'd see similar for other tests. But I need to hear test-specific reasons for the test-specific boost of 4x from what I think (120) is the default to 480. > Otherwise I'd prefer no change, or a small change, by maybe 1.5x not 4x, and we'll adjust the test when we see evidence that it is not enough. > @prrace the change maintains the same absolute timeout value for those tests. Before the default of 120 was multiplied by the timeoutFactor of 4 to given 480. Now the value 480 is multiplied by the timeoutFactor of 1 to give 480. And IIRC Leo only did that for tests that demonstrated a timeout with the new default settings (120*1). It is not practical for Leo to investigate every changed test to see if it could get away with a value between 120 and 480. The change just maintains the status quo. Test owners are free to investigate further if they think it worth fine tuning these values. I don't agree. If you are going to modify individual tests, you need to demonstrate what you did for that test is justified or don't do it. I am also questioning whether such a time out was demonstrated for this test. I've searched the entire history of CI jobs and I don't see where Leo had such a timeout of this test. I can send you my query off-line so you can check it. Maybe it is incomplete. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294258341 From ayang at openjdk.org Fri Aug 22 18:45:53 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 22 Aug 2025 18:45:53 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 17:18:40 GMT, Phil Race wrote: > or don't do it. Adding `/timeout=480` is more or less don't do anything. The default timeout (if omitting `/timeout=...`) is 120, so: master: TIMEOUT_FACTOR=4 and /timeout=120 give you actual 480 timeout. patch: TIMEOUT_FACTOR=1 and /timeout=480 give you the same timeout. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2294425045 From duke at openjdk.org Fri Aug 22 23:56:52 2025 From: duke at openjdk.org (ExE Boss) Date: Fri, 22 Aug 2025 23:56:52 GMT Subject: RFR: 8365983: Tests should throw SkippedException when SCTP not supported In-Reply-To: References: Message-ID: <_FKCrXqIsMuPU7l2NETr9BgIElytHVjeQVxZb5-_nf4=.dba99862-fbee-422a-8b4a-e7aabea7439d@github.com> On Fri, 22 Aug 2025 13:30:19 GMT, SendaoYan wrote: > Currently, take test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java as example. When Util.isSCTPSupported() return false, then test print a warning and the exit. > > I think it's better to throw jtreg.SkippedException rather than only print a warning and then report test passed. > > Change has been verified locally, test-fix only, almost no risk. test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java line 2: > 1: /* > 2: * Copyright (c) 2009, 2025 Oracle and/or its affiliates. All rights reserved. Missing comma: Suggestion: * Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26903#discussion_r2294949015 From bpb at openjdk.org Sat Aug 23 01:28:02 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Sat, 23 Aug 2025 01:28:02 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 16:45:26 GMT, Alan Bateman wrote: > This lead to the suggestion to choose a naming convention to avoid mistakes. As there are only a couple of methods that return `errno`, then maybe something like `fstatat0NoThrow` or `fstatat0errno` and leave the ones that throw as they are? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26889#issuecomment-3216070963 From syan at openjdk.org Sat Aug 23 02:17:18 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 23 Aug 2025 02:17:18 GMT Subject: RFR: 8365983: Tests should throw SkippedException when SCTP not supported [v2] In-Reply-To: References: Message-ID: > Currently, take test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java as example. When Util.isSCTPSupported() return false, then test print a warning and the exit. > > I think it's better to throw jtreg.SkippedException rather than only print a warning and then report test passed. > > Change has been verified locally, test-fix only, almost no risk. SendaoYan has updated the pull request incrementally with one additional commit since the last revision: Replace "throw new jtreg.SkippedException" ad "throw new SkippedException" ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26903/files - new: https://git.openjdk.org/jdk/pull/26903/files/566b95ee..eb1b137f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26903&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26903&range=00-01 Stats: 23 lines in 16 files changed: 4 ins; 0 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/26903.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26903/head:pull/26903 PR: https://git.openjdk.org/jdk/pull/26903 From syan at openjdk.org Sat Aug 23 02:26:50 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 23 Aug 2025 02:26:50 GMT Subject: RFR: 8365983: Tests should throw SkippedException when SCTP not supported [v2] In-Reply-To: <_FKCrXqIsMuPU7l2NETr9BgIElytHVjeQVxZb5-_nf4=.dba99862-fbee-422a-8b4a-e7aabea7439d@github.com> References: <_FKCrXqIsMuPU7l2NETr9BgIElytHVjeQVxZb5-_nf4=.dba99862-fbee-422a-8b4a-e7aabea7439d@github.com> Message-ID: On Fri, 22 Aug 2025 23:54:13 GMT, ExE Boss wrote: >> SendaoYan has updated the pull request incrementally with one additional commit since the last revision: >> >> Replace "throw new jtreg.SkippedException" ad "throw new SkippedException" > > test/jdk/com/sun/nio/sctp/SctpMultiChannel/Branch.java line 2: > >> 1: /* >> 2: * Copyright (c) 2009, 2025 Oracle and/or its affiliates. All rights reserved. > > Missing comma: > Suggestion: > > * Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved. Thanks. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26903#discussion_r2295022937 From syan at openjdk.org Sat Aug 23 02:53:28 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 23 Aug 2025 02:53:28 GMT Subject: RFR: 8366031: Mark com/sun/nio/sctp/SctpChannel/CloseDescriptors.java as intermittent Message-ID: The test com/sun/nio/sctp/SctpChannel/CloseDescriptors.java observed intermittent fails. Before the root cause of failure has been fixed, should we mark this test `@key intermittent`, to make some setups skip this test or re-run this test when it's fails. After the failure root cause has been fixed, we should remove the `@key intermittent` in test definition. ------------- Commit messages: - 8366031: Mark com/sun/nio/sctp/SctpChannel/CloseDescriptors.java as @intermittent Changes: https://git.openjdk.org/jdk/pull/26910/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26910&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366031 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26910.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26910/head:pull/26910 PR: https://git.openjdk.org/jdk/pull/26910 From alanb at openjdk.org Sun Aug 24 06:57:55 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 24 Aug 2025 06:57:55 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 16:51:01 GMT, Brian Burkhalter wrote: > > UnixFileAttributes.getIfExists is performance critical so this is why it the native method returns errno rather than throws. > > So the `stat0` and `fstatat0` methods should revert to returning `errno`. Right, these are private. UnixNativeDispatcher will define stat and fstatat that throw UnixException for all errors. The variant of stat that doesn't thrown is currently named stat2, I assumed we would have fstatat2 too. We can choose better names of course. It means that 2-arg getIfExists won't need to rely on exceptions for control flow, and means the 1-arg getIfExists can be re-implemented to use to use the 2-arg getIfExists. It also avoids the hazard of changing an existing method to not throw when the naming and existing usages assume an exception for all error cases. Longer term we could get rid of all the exception throwing in the JNI functions and have them return -errno. This is how some of the new syscalls work anyway as the negative range isn't otherwise used. I'm not suggesting we do this now. If this code is eventually replaced to use FFM then it would be minimally disruptive to the file system provider implementation. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26889#issuecomment-3217889918 From alanb at openjdk.org Sun Aug 24 07:32:02 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 24 Aug 2025 07:32:02 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v4] In-Reply-To: References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: On Mon, 11 Aug 2025 19:06:29 GMT, Brian Burkhalter wrote: >> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8361495: Remove commented out code and low value print statement test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 43: > 41: import org.junit.jupiter.api.Test; > 42: > 43: public class ChannelInputStreamTest { This is a test for async close of input/output streams obtained from Channels.newInputStream and Channels.newOutputStream so we need to decide whether to put the test and how to name it. Maybe channels/Channels/AsyncCloseStreams.java so it is located with the other tests for Channels? test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 75: > 73: in = Files.newInputStream(path); > 74: } catch (IOException ignored) { > 75: continue; Why is the exception ignored? test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 100: > 98: closeThread.join(); > 99: } catch (InterruptedException ignored) { > 100: } I assume we shouldn't catch InterruptedExcepiton here, this could only happen if at test timeout and jtreg is attempted to cleanup. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296547068 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296547174 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296547450 From alanb at openjdk.org Sun Aug 24 07:49:59 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 24 Aug 2025 07:49:59 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v4] In-Reply-To: References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: On Mon, 11 Aug 2025 19:06:29 GMT, Brian Burkhalter wrote: >> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8361495: Remove commented out code and low value print statement test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 48: > 46: do { > 47: Object obj; > 48: if ((obj = q.poll()) != null) { poll doesn't block so I assume this means the close test spins. Have you tried a blocking take? test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 64: > 62: @Test > 63: public void available() throws IOException { > 64: var close = new ConcurrentLinkedQueue(); Maybe `static final Closeable STOP = () -> { };` would help here, it means mean the CLQ (maybe LTQ is better) doesn't need to be Object. Alternatively, the tests can just closeThread.interrupt. test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 65: > 63: public void available() throws IOException { > 64: var close = new ConcurrentLinkedQueue(); > 65: Thread closeThread = startCloseThread(close); I think clear to put a try-finally after this, where the finally does the closeThread.join. test/jdk/java/nio/channels/FileChannel/ChannelInputStreamTest.java line 89: > 87: } catch (Throwable t) { > 88: close.offer(new Object()); > 89: throw new RuntimeException("Unexpected error", t); This is junit test so I assume you can use "fail" rather than throw RuntimeException here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296551442 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296552976 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296553656 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2296553277 From alanb at openjdk.org Sun Aug 24 09:58:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 24 Aug 2025 09:58:52 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 18:43:29 GMT, Albert Mingkun Yang wrote: >>> @prrace the change maintains the same absolute timeout value for those tests. Before the default of 120 was multiplied by the timeoutFactor of 4 to given 480. Now the value 480 is multiplied by the timeoutFactor of 1 to give 480. And IIRC Leo only did that for tests that demonstrated a timeout with the new default settings (120*1). It is not practical for Leo to investigate every changed test to see if it could get away with a value between 120 and 480. The change just maintains the status quo. Test owners are free to investigate further if they think it worth fine tuning these values. >> >> I don't agree. >> If you are going to modify individual tests, you need to demonstrate what you did for that test is justified or don't do it. >> >> I am also questioning whether such a time out was demonstrated for this test. >> I've searched the entire history of CI jobs and I don't see where Leo had such a timeout of this test. >> I can send you my query off-line so you can check it. Maybe it is incomplete. > >> or don't do it. > > Adding `/timeout=480` is more or less don't do anything. > > The default timeout (if omitting `/timeout=...`) is 120, so: > > master: TIMEOUT_FACTOR=4 and /timeout=120 give you actual 480 timeout. > patch: TIMEOUT_FACTOR=1 and /timeout=480 give you the same timeout. > If you are going to modify individual tests, you need to demonstrate what you did for that test is justified or don't do it. There are several comments in this PR pointing out again and again that adding "/timeout=480" doesn't change anything with the new proposed default timeout and timeoutFactor. I was initially puzzled as to why these were being added to a lot of tests but I think Leo's runs with a timeoutFactor of 0.7 explains it. If the timeoutFactor is reduced then we risk timeouts from tests that are run close to the limit today. The method used to find these tests seems reasonable. So I think the approach is good and we should try to help him get this change integrated to avoid needing to keep it up to date while tests change in main line. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2296595504 From dholmes at openjdk.org Sun Aug 24 22:54:03 2025 From: dholmes at openjdk.org (David Holmes) Date: Sun, 24 Aug 2025 22:54:03 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 15:41:21 GMT, Albert Mingkun Yang wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/hotspot/jtreg/compiler/tiered/Level2RecompilationTest.java line 36: > >> 34: * @build jdk.test.whitebox.WhiteBox >> 35: * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox >> 36: * @run main/othervm/timeout=960 -Xbootclasspath/a:. -XX:+TieredCompilation > > Why not `480` in this case? Leo also states in the description: > In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2296840413 From vyazici at openjdk.org Mon Aug 25 07:46:59 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 25 Aug 2025 07:46:59 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v7] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: - Improve "sneaky throws" - Improve comment style ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/a73b446a..584e6e21 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=05-06 Stats: 51 lines in 1 file changed: 16 ins; 6 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Mon Aug 25 07:51:52 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 25 Aug 2025 07:51:52 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v6] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 14:25:19 GMT, Roger Riggs wrote: >> Volkan Yazici has updated the pull request incrementally with five additional commits since the last revision: >> >> - Renamed to `malformedASCII` >> - Improve exception parametrization >> - Document parametrization on the exception type >> - Avoid using links in the Javadoc title line >> - Rename `NoReplTest` and fix its copyright year > > src/java.base/share/classes/java/lang/String.java line 1316: > >> 1314: >> 1315: @SuppressWarnings("unchecked") >> 1316: private static E malformedInputException(int off, int nb, Class exceptionClass) { > > The argument name can be "_", since it is ignored and is unused in the body. > Comment the method as always throwing MalformedInputException. > Similarly in the other malformedInput methods*. I've removed the need to pass a `Class` to these exception factories, and improved their documentation in 584e6e213ec. > The argument name can be "_", since it is ignored and is unused in the body. For the record, AFAIK, this is not possible for method arguments. Quoting [?6.1 (Names > Declarations)](https://docs.oracle.com/javase/specs/jls/se24/html/jls-6.html#jls-6.1): > If a declaration does not include an identifier, but instead includes the keyword _ (underscore), then the entity cannot be referred to by name. The following kinds of entity may be declared using an underscore: > > * A local variable, one of the following: ... > * An exception parameter of an exception handler declared in a catch clause of a try statement > * A formal parameter of a lambda expression ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2297377015 From lkorinth at openjdk.org Mon Aug 25 10:52:01 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 25 Aug 2025 10:52:01 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Sun, 24 Aug 2025 22:51:05 GMT, David Holmes wrote: >> test/hotspot/jtreg/compiler/tiered/Level2RecompilationTest.java line 36: >> >>> 34: * @build jdk.test.whitebox.WhiteBox >>> 35: * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox >>> 36: * @run main/othervm/timeout=960 -Xbootclasspath/a:. -XX:+TieredCompilation >> >> Why not `480` in this case? > > Leo also states in the description: > >> In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. In a few places, I have got timeouts after adjusting the timeout value. This is most likely because I have used a timeout factor of 0.7 to minimise "flickering" behaviour before finally changing to a timeout factor of 1. One consequence of this is that a few test cases will have double the original timeout (those test that would not pass a reduction to 0.7). So in all the instances when the timeout factor is exactly two times the size, the reason is that I have realised that I have already adjusted the timeout and I do not want to quad it again. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297765975 From lkorinth at openjdk.org Mon Aug 25 10:52:09 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 25 Aug 2025 10:52:09 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 15:44:28 GMT, Albert Mingkun Yang wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/hotspot/jtreg/runtime/cds/appcds/LotsOfSyntheticClasses.java line 40: > >> 38: * @requires vm.cds >> 39: * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds >> 40: * @run driver/timeout=8000 LotsOfSyntheticClasses > > I was expecting `500 * 4 = 2000`, instead of `8000` here. This is another instance of ([double after quad ](https://github.com/openjdk/jdk/pull/26749#discussion_r2297765975)). > test/jdk/java/util/HashMap/WhiteBoxResizeTest.java line 60: > >> 58: * @comment skip running this test on 32 bit VM >> 59: * @requires vm.bits == "64" >> 60: * @run testng/othervm/timeout=960 -Xmx2g WhiteBoxResizeTest > > Why not `480`? This is another instance of ([double after quad ](https://github.com/openjdk/jdk/pull/26749#discussion_r2297765975)). > test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.java line 34: > >> 32: * @build com.foobar.Utils >> 33: * com.bar.* >> 34: * @run junit/othervm/timeout=960 -Djava.locale.providers=CLDR,SPI LocaleNameProviderTest > > Why not `480`? This is another instance of ([double after quad ](https://github.com/openjdk/jdk/pull/26749#discussion_r2297765975)). > test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java line 49: > >> 47: * @library /test/lib /test/jdk >> 48: * @modules jdk.jfr/jdk.jfr.internal.test >> 49: * @run main/othervm/timeout=960 -XX:TLABSize=2k jdk.jfr.event.oldobject.TestObjectDescription > > Why not `480`? This is another instance of ([double after quad ](https://github.com/openjdk/jdk/pull/26749#discussion_r2297765975)). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297768577 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297773391 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297773648 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297774209 From lkorinth at openjdk.org Mon Aug 25 11:04:00 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 25 Aug 2025 11:04:00 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 16:06:16 GMT, Albert Mingkun Yang wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/langtools/jdk/jshell/HangingRemoteAgent.java line 38: > >> 36: class HangingRemoteAgent extends RemoteExecutionControl { >> 37: >> 38: private static final int TIMEOUT = (int)(2000 * Double.parseDouble(System.getProperty("test.timeout.factor", "1.0"))); > > why not `Utils.TIMEOUT_FACTOR`? There are a few places where I have changed java files that are not jtreg tests themself. The code is used by a jtreg test, but is not the "entry" into a test. Those files have no way to specify `@library` annotations, as no "test annotations" are parsed. It is a pity that a jtreg "library" can not specify dependencies to other "libraries". > test/langtools/jdk/jshell/UITesting.java line 148: > >> 146: } >> 147: >> 148: private static final long TIMEOUT = (long) (60_000 * Double.parseDouble(System.getProperty("test.timeout.factor", "1.0"))); > > Why not `Utils.TIMEOUT_FACTOR`? [see above](https://github.com/openjdk/jdk/pull/26749#discussion_r2297800775) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297800775 PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297802941 From lkorinth at openjdk.org Mon Aug 25 11:19:53 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 25 Aug 2025 11:19:53 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 17:05:59 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > update testing.md, remove makefile link, fix bad text I am awaiting Oracle internal feedback if you wonder why I have still not updated copyright and integrated. Target date for integration is second of September. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3219867507 From lkorinth at openjdk.org Mon Aug 25 11:43:54 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 25 Aug 2025 11:43:54 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 15:55:38 GMT, Albert Mingkun Yang wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/jdk/java/rmi/transport/dgcDeadLock/DGCDeadLock.java line 59: > >> 57: public class DGCDeadLock implements Runnable { >> 58: final static public int HOLD_TARGET_TIME = 25000; >> 59: public static final double TEST_FAIL_TIME = (HOLD_TARGET_TIME + 30000) * Math.max(TestLibrary.getTimeoutFactor(), 4); > > Why `max(...)`? If it's for backwards compatibility, shouldn't it be `(HOLD_TARGET_TIME + 30000) * 4 * TestLibrary.getTimeoutFactor()`? It is a way to give a "4x" lowest value, while not multiplying a 10x factor with four resulting in a 40x factor. I think (but I am not sure) that it would sometime time out if I only used the given timeout factor and not "guarding" with the max(x, 4). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2297876217 From ayang at openjdk.org Mon Aug 25 13:50:55 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Mon, 25 Aug 2025 13:50:55 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Mon, 25 Aug 2025 11:40:56 GMT, Leo Korinth wrote: > while not multiplying a 10x factor with four resulting in a 40x factor. Why is that undesirable? The base is `(HOLD_TARGET_TIME + 30000) * 4` and the timeout-factor changes that linearly. Using `max(..., 4)` here may come as a surprise to end users, IMO. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2298163658 From bpb at openjdk.org Mon Aug 25 19:44:13 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 25 Aug 2025 19:44:13 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v3] In-Reply-To: References: Message-ID: > In the Unix implementation of `sun.nio.fs`, change > > 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and > 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8365807: Reinstate stat2; add fstatat2 returning errno ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26889/files - new: https://git.openjdk.org/jdk/pull/26889/files/7ea1b084..91bb2e41 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=01-02 Stats: 53 lines in 3 files changed: 28 ins; 7 del; 18 mod Patch: https://git.openjdk.org/jdk/pull/26889.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26889/head:pull/26889 PR: https://git.openjdk.org/jdk/pull/26889 From bpb at openjdk.org Mon Aug 25 19:44:20 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 25 Aug 2025 19:44:20 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v2] In-Reply-To: References: Message-ID: On Sun, 24 Aug 2025 06:53:41 GMT, Alan Bateman wrote: > The variant of stat that doesn't thrown is currently named stat2, I assumed we would have fstatat2 too. The commit 91bb2e4 now has `fstatat2`. Note however that `stat2` is now no longer used as its only previous use had been in the 1-arg `getIfExists` which now just calls the 2-arg version. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26889#issuecomment-3221519230 From bpb at openjdk.org Mon Aug 25 23:13:28 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Mon, 25 Aug 2025 23:13:28 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v5] In-Reply-To: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: > Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - 8361495: Rename test and improve as suggested - Merge - 8361495: Remove commented out code and low value print statement - 8361495: Add read and write tests and convert to JUnit 5 - 8361495: Clean up initial test - 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26435/files - new: https://git.openjdk.org/jdk/pull/26435/files/a39b2f1b..dd4093a1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26435&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26435&range=03-04 Stats: 57062 lines in 1496 files changed: 30780 ins; 20141 del; 6141 mod Patch: https://git.openjdk.org/jdk/pull/26435.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26435/head:pull/26435 PR: https://git.openjdk.org/jdk/pull/26435 From jpai at openjdk.org Tue Aug 26 05:33:03 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 26 Aug 2025 05:33:03 GMT Subject: RFR: 8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file Message-ID: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> Can I please get a review of this test-only change which fixes a typo in a test method? The `test/jdk/jdk/nio/zipfs/TestPosix.java` test was introduced in Java 14 in https://bugs.openjdk.org/browse/JDK-8213031. This test has several test methods. One of those is the `testJarFile()` which first creates a JAR file `JAR_FILE` and then uses a `JarFile` instance to open that JAR file. There's however a typo in that code which causes the test method to use `JarFile` to open an unrelated `ZIP_FILE`. The reason why this test passes is because there's another test method in that test which previously has created the `ZIP_FILE` and thus the `JarFile` is able to open and parse that file. A failure of this `testJarFile()` test method can be reproduced by changing the order of these test methods to enusre that this test method is run before the others. Doing so results in the following exception: STARTED TestPosix::testJarFile 'testJarFile()' java.nio.file.NoSuchFileException: testPosix.zip at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:57) at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:162) at java.base/java.nio.file.Files.readAttributes(Files.java:1702) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1505) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:705) at java.base/java.util.zip.ZipFile.(ZipFile.java:204) at java.base/java.util.zip.ZipFile.(ZipFile.java:150) at java.base/java.util.jar.JarFile.(JarFile.java:336) at java.base/java.util.jar.JarFile.(JarFile.java:309) at java.base/java.util.jar.JarFile.(JarFile.java:279) at TestPosix.testJarFile(TestPosix.java:764) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) FAILED TestPosix::testJarFile 'testJarFile()' [32ms] The commit in this PR fixes that typo. ------------- Commit messages: - 8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file Changes: https://git.openjdk.org/jdk/pull/26936/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26936&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366128 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/26936.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26936/head:pull/26936 PR: https://git.openjdk.org/jdk/pull/26936 From alanb at openjdk.org Tue Aug 26 06:06:34 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 26 Aug 2025 06:06:34 GMT Subject: RFR: 8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file In-Reply-To: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> References: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> Message-ID: On Tue, 26 Aug 2025 05:25:10 GMT, Jaikiran Pai wrote: > Can I please get a review of this test-only change which fixes a typo in a test method? > > The `test/jdk/jdk/nio/zipfs/TestPosix.java` test was introduced in Java 14 in https://bugs.openjdk.org/browse/JDK-8213031. This test has several test methods. One of those is the `testJarFile()` which first creates a JAR file `JAR_FILE` and then uses a `JarFile` instance to open that JAR file. There's however a typo in that code which causes the test method to use `JarFile` to open an unrelated `ZIP_FILE`. The reason why this test passes is because there's another test method in that test which previously has created the `ZIP_FILE` and thus the `JarFile` is able to open and parse that file. > > A failure of this `testJarFile()` test method can be reproduced by changing the order of these test methods to enusre that this test method is run before the others. Doing so results in the following exception: > > > STARTED TestPosix::testJarFile 'testJarFile()' > java.nio.file.NoSuchFileException: testPosix.zip > at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) > at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) > at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) > at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:57) > at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:162) > at java.base/java.nio.file.Files.readAttributes(Files.java:1702) > at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1505) > at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:705) > at java.base/java.util.zip.ZipFile.(ZipFile.java:204) > at java.base/java.util.zip.ZipFile.(ZipFile.java:150) > at java.base/java.util.jar.JarFile.(JarFile.java:336) > at java.base/java.util.jar.JarFile.(JarFile.java:309) > at java.base/java.util.jar.JarFile.(JarFile.java:279) > at TestPosix.testJarFile(TestPosix.java:764) > at java.base/java.lang.reflect.Method.invoke(Method.java:565) > at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) > at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) > FAILED TestPosix::testJarFile 'testJarFile()' [32ms] > > > The commit in this PR fixes that typo. Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26936#pullrequestreview-3154057025 From alanb at openjdk.org Tue Aug 26 06:47:36 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 26 Aug 2025 06:47:36 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v5] In-Reply-To: References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: On Mon, 25 Aug 2025 23:13:28 GMT, Brian Burkhalter wrote: >> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. > > Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - 8361495: Rename test and improve as suggested > - Merge > - 8361495: Remove commented out code and low value print statement > - 8361495: Add read and write tests and convert to JUnit 5 > - 8361495: Clean up initial test > - 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 52: > 50: try { > 51: Closeable c; > 52: if ((c = q.take()) != null) { The loop could be simplified to use `while ((c = q.take()) != STOP)`. test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 99: > 97: } > 98: } while (true); > 99: } finally { If the finally blocks were to offer the STOP element then it would remove it from the 3 exit paths and make it more robust. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2299951671 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2299954521 From alanb at openjdk.org Tue Aug 26 06:55:38 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 26 Aug 2025 06:55:38 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v5] In-Reply-To: References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: On Mon, 25 Aug 2025 23:13:28 GMT, Brian Burkhalter wrote: >> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. > > Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - 8361495: Rename test and improve as suggested > - Merge > - 8361495: Remove commented out code and low value print statement > - 8361495: Add read and write tests and convert to JUnit 5 > - 8361495: Clean up initial test > - 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 85: > 83: available = in.available(); > 84: } catch (AsynchronousCloseException ace) { > 85: System.out.println("AsynchronousCloseException caught"); JUnit prints to stderr so this trace message won't be inlined with the test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2299971909 From alanb at openjdk.org Tue Aug 26 07:09:42 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 26 Aug 2025 07:09:42 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v3] In-Reply-To: References: Message-ID: On Mon, 25 Aug 2025 19:44:13 GMT, Brian Burkhalter wrote: >> In the Unix implementation of `sun.nio.fs`, change >> >> 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and >> 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8365807: Reinstate stat2; add fstatat2 returning errno I think this looks good and avoids the hazards from the early iterations. src/java.base/unix/classes/sun/nio/fs/UnixFileAttributes.java line 87: > 85: // Returns null if the file does not exist. > 86: static UnixFileAttributes getIfExists(UnixPath path) throws UnixException > 87: { Minor style nit, the "{" can move to the previous line. src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java line 292: > 290: */ > 291: static void fstatat(int dfd, UnixPath path, int flag, UnixFileAttributes attrs) > 292: throws UnixException Minor style nit, we've ended with two spaces between void and fstatat. src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java line 306: > 304: // Variant of fstatat() returning errno instead of throwing UnixException > 305: static int fstatat2(int dfd, UnixPath path, int flag, UnixFileAttributes attrs) > 306: { Minor style nit, the "{" can move to the previous line. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26889#pullrequestreview-3154237578 PR Review Comment: https://git.openjdk.org/jdk/pull/26889#discussion_r2300001804 PR Review Comment: https://git.openjdk.org/jdk/pull/26889#discussion_r2300003378 PR Review Comment: https://git.openjdk.org/jdk/pull/26889#discussion_r2300001649 From jpai at openjdk.org Tue Aug 26 11:51:34 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 26 Aug 2025 11:51:34 GMT Subject: RFR: 8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file In-Reply-To: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> References: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> Message-ID: On Tue, 26 Aug 2025 05:25:10 GMT, Jaikiran Pai wrote: > Can I please get a review of this test-only change which fixes a typo in a test method? > > The `test/jdk/jdk/nio/zipfs/TestPosix.java` test was introduced in Java 14 in https://bugs.openjdk.org/browse/JDK-8213031. This test has several test methods. One of those is the `testJarFile()` which first creates a JAR file `JAR_FILE` and then uses a `JarFile` instance to open that JAR file. There's however a typo in that code which causes the test method to use `JarFile` to open an unrelated `ZIP_FILE`. The reason why this test passes is because there's another test method in that test which previously has created the `ZIP_FILE` and thus the `JarFile` is able to open and parse that file. > > A failure of this `testJarFile()` test method can be reproduced by changing the order of these test methods to enusre that this test method is run before the others. Doing so results in the following exception: > > > STARTED TestPosix::testJarFile 'testJarFile()' > java.nio.file.NoSuchFileException: testPosix.zip > at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) > at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) > at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) > at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:57) > at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:162) > at java.base/java.nio.file.Files.readAttributes(Files.java:1702) > at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1505) > at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:705) > at java.base/java.util.zip.ZipFile.(ZipFile.java:204) > at java.base/java.util.zip.ZipFile.(ZipFile.java:150) > at java.base/java.util.jar.JarFile.(JarFile.java:336) > at java.base/java.util.jar.JarFile.(JarFile.java:309) > at java.base/java.util.jar.JarFile.(JarFile.java:279) > at TestPosix.testJarFile(TestPosix.java:764) > at java.base/java.lang.reflect.Method.invoke(Method.java:565) > at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) > at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) > FAILED TestPosix::testJarFile 'testJarFile()' [32ms] > > > The commit in this PR fixes that typo. Thank you Alan for the review. I verified that the test passes in our CI with this change. Since this is a trivial one liner typo fix in a test, I'll go ahead and integrate this now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26936#issuecomment-3223850602 From jpai at openjdk.org Tue Aug 26 11:58:43 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 26 Aug 2025 11:58:43 GMT Subject: Integrated: 8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file In-Reply-To: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> References: <3gXWhn1bbmTzmZR91MTAD4q2HWZAA68pQkTXXydPSd0=.09a8e7bf-706c-489c-ad8c-f875b7a15c54@github.com> Message-ID: On Tue, 26 Aug 2025 05:25:10 GMT, Jaikiran Pai wrote: > Can I please get a review of this test-only change which fixes a typo in a test method? > > The `test/jdk/jdk/nio/zipfs/TestPosix.java` test was introduced in Java 14 in https://bugs.openjdk.org/browse/JDK-8213031. This test has several test methods. One of those is the `testJarFile()` which first creates a JAR file `JAR_FILE` and then uses a `JarFile` instance to open that JAR file. There's however a typo in that code which causes the test method to use `JarFile` to open an unrelated `ZIP_FILE`. The reason why this test passes is because there's another test method in that test which previously has created the `ZIP_FILE` and thus the `JarFile` is able to open and parse that file. > > A failure of this `testJarFile()` test method can be reproduced by changing the order of these test methods to enusre that this test method is run before the others. Doing so results in the following exception: > > > STARTED TestPosix::testJarFile 'testJarFile()' > java.nio.file.NoSuchFileException: testPosix.zip > at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) > at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) > at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) > at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:57) > at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:162) > at java.base/java.nio.file.Files.readAttributes(Files.java:1702) > at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1505) > at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:705) > at java.base/java.util.zip.ZipFile.(ZipFile.java:204) > at java.base/java.util.zip.ZipFile.(ZipFile.java:150) > at java.base/java.util.jar.JarFile.(JarFile.java:336) > at java.base/java.util.jar.JarFile.(JarFile.java:309) > at java.base/java.util.jar.JarFile.(JarFile.java:279) > at TestPosix.testJarFile(TestPosix.java:764) > at java.base/java.lang.reflect.Method.invoke(Method.java:565) > at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) > at java.base/java.util.ArrayList.forEach(ArrayList.java:1604) > FAILED TestPosix::testJarFile 'testJarFile()' [32ms] > > > The commit in this PR fixes that typo. This pull request has now been integrated. Changeset: 22d3a6dd Author: Jaikiran Pai URL: https://git.openjdk.org/jdk/commit/22d3a6dd34a14994c7210365a5b982c9e65f5892 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file Reviewed-by: alanb ------------- PR: https://git.openjdk.org/jdk/pull/26936 From bpb at openjdk.org Tue Aug 26 15:44:51 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 26 Aug 2025 15:44:51 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v4] In-Reply-To: References: Message-ID: > In the Unix implementation of `sun.nio.fs`, change > > 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and > 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8365807: Fix minor style nits ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26889/files - new: https://git.openjdk.org/jdk/pull/26889/files/91bb2e41..31ad86f7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26889&range=02-03 Stats: 5 lines in 2 files changed: 0 ins; 2 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26889.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26889/head:pull/26889 PR: https://git.openjdk.org/jdk/pull/26889 From alanb at openjdk.org Tue Aug 26 15:47:35 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 26 Aug 2025 15:47:35 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v4] In-Reply-To: References: Message-ID: On Tue, 26 Aug 2025 15:44:51 GMT, Brian Burkhalter wrote: >> In the Unix implementation of `sun.nio.fs`, change >> >> 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and >> 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8365807: Fix minor style nits Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26889#pullrequestreview-3156274435 From dclarke at openjdk.org Tue Aug 26 16:04:56 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Tue, 26 Aug 2025 16:04:56 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v3] In-Reply-To: References: Message-ID: > This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. > > These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. > > I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: moved repeating code into own method ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25546/files - new: https://git.openjdk.org/jdk/pull/25546/files/e2207883..9de0789e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25546&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25546&range=01-02 Stats: 27 lines in 4 files changed: 9 ins; 15 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25546.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25546/head:pull/25546 PR: https://git.openjdk.org/jdk/pull/25546 From bpb at openjdk.org Tue Aug 26 16:25:51 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 26 Aug 2025 16:25:51 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v6] In-Reply-To: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: <4IzayZGEmnQo53hYHxdp33NFX-ZCP7mXPakqFWeCoFQ=.e4a35b4f-8791-4dea-8937-f23a4316a3ae@github.com> > Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8361495: More test improvement ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26435/files - new: https://git.openjdk.org/jdk/pull/26435/files/dd4093a1..1f323f42 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26435&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26435&range=04-05 Stats: 26 lines in 1 file changed: 3 ins; 15 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/26435.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26435/head:pull/26435 PR: https://git.openjdk.org/jdk/pull/26435 From bpb at openjdk.org Tue Aug 26 16:25:53 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 26 Aug 2025 16:25:53 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v5] In-Reply-To: References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: <1J3MCFVa4r988EI3lV2Lb-fqkGLw3sfToOn5b8pUnmM=.bf97ae20-5616-49fa-a1bc-06104022ac3f@github.com> On Tue, 26 Aug 2025 06:43:22 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: >> >> - 8361495: Rename test and improve as suggested >> - Merge >> - 8361495: Remove commented out code and low value print statement >> - 8361495: Add read and write tests and convert to JUnit 5 >> - 8361495: Clean up initial test >> - 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases > > test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 52: > >> 50: try { >> 51: Closeable c; >> 52: if ((c = q.take()) != null) { > > The loop could be simplified to use `while ((c = q.take()) != STOP)`. Good. > test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 85: > >> 83: available = in.available(); >> 84: } catch (AsynchronousCloseException ace) { >> 85: System.out.println("AsynchronousCloseException caught"); > > JUnit prints to stderr so this trace message won't be inlined with the test. I know JUnit prints to stderr but I was going to remove the trace. I think it better now to redirect it to stderr. > test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 99: > >> 97: } >> 98: } while (true); >> 99: } finally { > > If the finally blocks were to offer the STOP element then it would remove it from the 3 exit paths and make it more robust. Good idea. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2301517528 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2301517797 PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2301517685 From mdonovan at openjdk.org Tue Aug 26 17:08:38 2025 From: mdonovan at openjdk.org (Matthew Donovan) Date: Tue, 26 Aug 2025 17:08:38 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 17:05:59 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > update testing.md, remove makefile link, fix bad text test/jdk/sun/security/krb5/name/Constructors.java line 28: > 26: * @summary Make PrincipalName and Realm immutable > 27: * @modules java.security.jgss/sun.security.krb5 > 28: * @run main/othervm Constructors Do you know why this test needs the change? It's not doing much (no blocking calls) and on my system runs in about a tenth of a second. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2301616789 From bpb at openjdk.org Tue Aug 26 17:45:40 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 26 Aug 2025 17:45:40 GMT Subject: RFR: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow [v4] In-Reply-To: References: Message-ID: On Tue, 26 Aug 2025 15:44:51 GMT, Brian Burkhalter wrote: >> In the Unix implementation of `sun.nio.fs`, change >> >> 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and >> 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8365807: Fix minor style nits Tier 1-3 jobs passed on Unix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26889#issuecomment-3225121237 From bpb at openjdk.org Tue Aug 26 17:45:41 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 26 Aug 2025 17:45:41 GMT Subject: Integrated: 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow In-Reply-To: References: Message-ID: On Thu, 21 Aug 2025 22:03:40 GMT, Brian Burkhalter wrote: > In the Unix implementation of `sun.nio.fs`, change > > 1. `UnixFileAttributes.getIfExists(UnixPath,boolean)` to use the system call success status and `errno` for control flow; and > 2. `UnixFileAttributes.getIfExists(UnixPath)` to simply return `UnixFileAttributes.getIfExists(UnixPath,true)`. This pull request has now been integrated. Changeset: 2b44ed70 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/2b44ed70707175f87ba962d8a6ce6bbc2c8737bf Stats: 57 lines in 3 files changed: 18 ins; 21 del; 18 mod 8365807: (fs) Two-arg UnixFileAttributes.getIfExists should not use exception for control flow Reviewed-by: alanb ------------- PR: https://git.openjdk.org/jdk/pull/26889 From alanb at openjdk.org Tue Aug 26 19:53:35 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 26 Aug 2025 19:53:35 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v6] In-Reply-To: <4IzayZGEmnQo53hYHxdp33NFX-ZCP7mXPakqFWeCoFQ=.e4a35b4f-8791-4dea-8937-f23a4316a3ae@github.com> References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> <4IzayZGEmnQo53hYHxdp33NFX-ZCP7mXPakqFWeCoFQ=.e4a35b4f-8791-4dea-8937-f23a4316a3ae@github.com> Message-ID: On Tue, 26 Aug 2025 16:25:51 GMT, Brian Burkhalter wrote: >> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8361495: More test improvement Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26435#pullrequestreview-3157097156 From bpb at openjdk.org Wed Aug 27 00:15:41 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 00:15:41 GMT Subject: RFR: 8356493: (fs) SecureDirectoryStream missing some capabilities In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 00:07:38 GMT, Brian Burkhalter wrote: > Add several methods to `java.nio.file.SecureDirectoryStream`. This request proposes to add methods to `SecureDirectoryStream` to create files, directories, and links, and to read the target of a symbolic link. These methods were not in the original API as the corresponding POSIX `*at` system calls were not available at the time. This is no longer the case as discussed [here](https://bugs.openjdk.org/browse/JDK-8356493?focusedId=14808804&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14808804). A test is also modified to cover the new methods. A CSR will be filed if the proposal appears worth pursuing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26950#issuecomment-3226194104 From bpb at openjdk.org Wed Aug 27 00:15:41 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 00:15:41 GMT Subject: RFR: 8356493: (fs) SecureDirectoryStream missing some capabilities Message-ID: Add several methods to `java.nio.file.SecureDirectoryStream`. ------------- Commit messages: - 8356493: (fs) SecureDirectoryStream missing some capabilities Changes: https://git.openjdk.org/jdk/pull/26950/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26950&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356493 Stats: 666 lines in 6 files changed: 654 ins; 4 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/26950.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26950/head:pull/26950 PR: https://git.openjdk.org/jdk/pull/26950 From pminborg at openjdk.org Wed Aug 27 08:46:47 2025 From: pminborg at openjdk.org (Per Minborg) Date: Wed, 27 Aug 2025 08:46:47 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v3] In-Reply-To: References: Message-ID: <2Ba0mtRfzDkeFI0Upbio9CGMeJraWcQ50z-m1TAG9bE=.4d4d0edd-fe22-4a67-b185-68fa6785c797@github.com> On Tue, 26 Aug 2025 16:04:56 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: > > moved repeating code into own method src/java.base/macosx/classes/sun/nio/ch/KQueuePoller.java line 76: > 74: int i = 0; > 75: while (i < n) { > 76: MemorySegment eventMS = KQueue.getEvent(pollArray, i); Nit: Can we call these variables `eventSegment`? My reptile part of the brain first read "event in milliseconds". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2303289065 From shade at openjdk.org Wed Aug 27 14:17:04 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 27 Aug 2025 14:17:04 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software Message-ID: This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. Additional testing: - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions - [ ] Linux AArch64 server fastdebug, test does not fail after 1000x repetitions ------------- Commit messages: - Tunable try count - Fix Changes: https://git.openjdk.org/jdk/pull/26961/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26961&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8333783 Stats: 110 lines in 2 files changed: 70 ins; 23 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/26961.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26961/head:pull/26961 PR: https://git.openjdk.org/jdk/pull/26961 From bpb at openjdk.org Wed Aug 27 15:32:54 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 15:32:54 GMT Subject: Integrated: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases In-Reply-To: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> Message-ID: On Tue, 22 Jul 2025 23:21:23 GMT, Brian Burkhalter wrote: > Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. This pull request has now been integrated. Changeset: f1c0b4ed Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/f1c0b4ed722bf4cc5f262e804cec26d59ceb6e8b Stats: 163 lines in 2 files changed: 162 ins; 0 del; 1 mod 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases Reviewed-by: alanb ------------- PR: https://git.openjdk.org/jdk/pull/26435 From bpb at openjdk.org Wed Aug 27 15:32:53 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 15:32:53 GMT Subject: RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v6] In-Reply-To: <4IzayZGEmnQo53hYHxdp33NFX-ZCP7mXPakqFWeCoFQ=.e4a35b4f-8791-4dea-8937-f23a4316a3ae@github.com> References: <4LSh6MSWFPMMg_ay5AQ1wKcWen1gQEqmZ8JQpsLpReU=.b6252979-43bb-4c8d-ab9c-105cd3000996@github.com> <4IzayZGEmnQo53hYHxdp33NFX-ZCP7mXPakqFWeCoFQ=.e4a35b4f-8791-4dea-8937-f23a4316a3ae@github.com> Message-ID: On Tue, 26 Aug 2025 16:25:51 GMT, Brian Burkhalter wrote: >> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8361495: More test improvement CI tier 1-3 jobs passed on the usual OSes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26435#issuecomment-3228685437 From bpb at openjdk.org Wed Aug 27 17:56:21 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 17:56:21 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException Message-ID: Translate a `UnixException` with `errno == ELOOP` to `FileSystemLoopException` instead of the less specific `FileSystemException`. ------------- Commit messages: - 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException Changes: https://git.openjdk.org/jdk/pull/26966/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26966&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366254 Stats: 6 lines in 2 files changed: 2 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/26966.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26966/head:pull/26966 PR: https://git.openjdk.org/jdk/pull/26966 From alanb at openjdk.org Wed Aug 27 19:32:43 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 27 Aug 2025 19:32:43 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 17:50:13 GMT, Brian Burkhalter wrote: > Translate a `UnixException` with `errno == ELOOP` to `FileSystemLoopException` instead of the less specific `FileSystemException`. src/java.base/unix/classes/sun/nio/fs/UnixException.java line 97: > 95: if (errno() == UnixConstants.ELOOP) > 96: return new FileSystemLoopException(file + ", " + other + ", " > 97: + errorString() FileSystemLoopException doesn't have have a ctor for the 2-file usages, and 'other' may be null. So need to think if this should be handled at the use-site or whether they should just use 'file'. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26966#discussion_r2305112885 From bpb at openjdk.org Wed Aug 27 19:32:44 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 19:32:44 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 19:27:42 GMT, Alan Bateman wrote: > So need to think if this should be handled at the use-site or whether they should just use 'file'. I was actually trying to craft a better version of these lines just now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26966#discussion_r2305117001 From bpb at openjdk.org Wed Aug 27 19:39:17 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 19:39:17 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException [v2] In-Reply-To: References: Message-ID: > Translate a `UnixException` with `errno == ELOOP` to `FileSystemLoopException` instead of the less specific `FileSystemException`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8366254: Improve error message for ELOOP ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26966/files - new: https://git.openjdk.org/jdk/pull/26966/files/cf174cae..22ceb999 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26966&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26966&range=00-01 Stats: 5 lines in 1 file changed: 1 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/26966.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26966/head:pull/26966 PR: https://git.openjdk.org/jdk/pull/26966 From bpb at openjdk.org Wed Aug 27 19:39:17 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 19:39:17 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException [v2] In-Reply-To: References: Message-ID: <66KpIpaSuWrr_XEfnzj8gFAtRqS7Pf1PPaTl68uoUWs=.aafb5435-3fb7-4d95-a93a-95e3ae03b145@github.com> On Wed, 27 Aug 2025 19:29:57 GMT, Brian Burkhalter wrote: >> src/java.base/unix/classes/sun/nio/fs/UnixException.java line 97: >> >>> 95: if (errno() == UnixConstants.ELOOP) >>> 96: return new FileSystemLoopException(file + ", " + other + ", " >>> 97: + errorString() >> >> FileSystemLoopException doesn't have have a ctor for the 2-file usages, and 'other' may be null. So need to think if this should be handled at the use-site or whether they should just use 'file'. > >> So need to think if this should be handled at the use-site or whether they should just use 'file'. > > I was actually trying to craft a better version of these lines just now. See 22ceb99. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26966#discussion_r2305127358 From rriggs at openjdk.org Wed Aug 27 20:49:49 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 27 Aug 2025 20:49:49 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v7] In-Reply-To: References: Message-ID: On Mon, 25 Aug 2025 07:46:59 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Improve "sneaky throws" > - Improve comment style Look good, still pretty gnarly but the clever parts are encapsulated. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3161697438 From liach at openjdk.org Wed Aug 27 23:35:44 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 27 Aug 2025 23:35:44 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v7] In-Reply-To: References: Message-ID: On Mon, 25 Aug 2025 07:46:59 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Improve "sneaky throws" > - Improve comment style Marked as reviewed by liach (Reviewer). src/java.base/share/classes/java/lang/String.java line 890: > 888: > 889: private static byte[] encodeWithEncoder( > 890: Charset cs, byte coder, byte[] val, Class exceptionClass) Since `exceptionClass` is a dummy argument that can't actually control the type of exception thrown by this method, that it being null or not is the only thing that matters, I recommend documenting/commenting about this fact, as this is otherwise potentially confusing. Maybe a name to indicate this nature (I came up with `replacementSwitch` but this is for sure horrible) would help too I guess? ------------- PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3162113328 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2305538047 From bpb at openjdk.org Wed Aug 27 23:59:43 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 27 Aug 2025 23:59:43 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 14:05:14 GMT, Aleksey Shipilev wrote: > This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. > > This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. > > Additional testing: > - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately > - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions > - [ ] Linux AArch64 server fastdebug, test does not fail after 1000x repetitions This looks all right to me. I ran 500 repeats on each of Linux aarch64 and x64 in our CI and there were no failures. I did increment the reviewer count to two however so one more approval will be needed. ------------- Marked as reviewed by bpb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26961#pullrequestreview-3162263667 From duke at openjdk.org Thu Aug 28 00:00:48 2025 From: duke at openjdk.org (duke) Date: Thu, 28 Aug 2025 00:00:48 GMT Subject: Withdrawn: 8291652: (ch) java/nio/channels/SocketChannel/VectorIO.java failed with "Exception: Server 15: Timed out" In-Reply-To: References: Message-ID: On Mon, 30 Jun 2025 15:58:16 GMT, Jaikiran Pai wrote: > Can I please get a review of this test-only change which proposes to address an intermittent test failure in `java/nio/channels/SocketChannel/VectorIO.java`? > > As noted in https://bugs.openjdk.org/browse/JDK-8291652, this test has been failing intermittently in our CI. Some years back the test was improved to include additional debug logs to identify the root cause https://bugs.openjdk.org/browse/JDK-8180085. In a recent failure, these test logs indicate that the `Server` thread hadn't yet `accept()`ed a Socket connection, when the client side of the test threw an exception because it had waited for 8 seconds for the server side of the test to complete. > > The change in this PR updates the test to wait for the `Server` thread to reach a point where it is ready to `accept()` a Socket connection. Only after it reaches this state, the client side of the testing will be initiated. Furthermore, the artificial 8 second wait has been removed from this test and it now waits as long as it takes for the testing to complete. If the test waits far too long then the jtreg infrastructure will timeout the test and at the same time capture the necessary artifacts to help debug unexpected time outs. > > While at it, the test has also been updated to use `InetAddress.getLoopbackAddress()` instead of localhost. This should prevent any unexpected address mappings for localhost from playing a role in this test. > > With these changes, I've run the test more than 1000 times in our CI and it hasn't failed. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/26049 From jpai at openjdk.org Thu Aug 28 01:39:47 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 28 Aug 2025 01:39:47 GMT Subject: RFR: 8291652: (ch) java/nio/channels/SocketChannel/VectorIO.java failed with "Exception: Server 15: Timed out" In-Reply-To: References: Message-ID: On Mon, 30 Jun 2025 15:58:16 GMT, Jaikiran Pai wrote: > Can I please get a review of this test-only change which proposes to address an intermittent test failure in `java/nio/channels/SocketChannel/VectorIO.java`? > > As noted in https://bugs.openjdk.org/browse/JDK-8291652, this test has been failing intermittently in our CI. Some years back the test was improved to include additional debug logs to identify the root cause https://bugs.openjdk.org/browse/JDK-8180085. In a recent failure, these test logs indicate that the `Server` thread hadn't yet `accept()`ed a Socket connection, when the client side of the test threw an exception because it had waited for 8 seconds for the server side of the test to complete. > > The change in this PR updates the test to wait for the `Server` thread to reach a point where it is ready to `accept()` a Socket connection. Only after it reaches this state, the client side of the testing will be initiated. Furthermore, the artificial 8 second wait has been removed from this test and it now waits as long as it takes for the testing to complete. If the test waits far too long then the jtreg infrastructure will timeout the test and at the same time capture the necessary artifacts to help debug unexpected time outs. > > While at it, the test has also been updated to use `InetAddress.getLoopbackAddress()` instead of localhost. This should prevent any unexpected address mappings for localhost from playing a role in this test. > > With these changes, I've run the test more than 1000 times in our CI and it hasn't failed. Sorry Mark, I forgot to check your comment and respond to it. I will take a look shortly and revive this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26049#issuecomment-3230985275 From shade at openjdk.org Thu Aug 28 05:55:20 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 28 Aug 2025 05:55:20 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software [v2] In-Reply-To: References: Message-ID: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> > This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. > > This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. > > Additional testing: > - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately > - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions > - [x] Linux AArch64 server fastdebug, test does not fail after 10000x repetitions Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: Remove unnecessary changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26961/files - new: https://git.openjdk.org/jdk/pull/26961/files/763760fa..ccacf797 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26961&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26961&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 3 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26961.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26961/head:pull/26961 PR: https://git.openjdk.org/jdk/pull/26961 From shade at openjdk.org Thu Aug 28 05:55:20 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 28 Aug 2025 05:55:20 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 14:05:14 GMT, Aleksey Shipilev wrote: > This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. > > This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. > > Additional testing: > - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately > - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions > - [x] Linux AArch64 server fastdebug, test does not fail after 10000x repetitions Thanks! I noticed I had some debugging left-overs, removed them now. The test completed 10000x iterations overnight on the machine where it used to fail 1/5 of the times, which tells me this thing works. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26961#issuecomment-3231991528 From vyazici at openjdk.org Thu Aug 28 08:16:41 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 08:16:41 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException [v2] In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 19:39:17 GMT, Brian Burkhalter wrote: >> Translate a `UnixException` with `errno == ELOOP` to `FileSystemLoopException` instead of the less specific `FileSystemException`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8366254: Improve error message for ELOOP LGTM. (I'd wait for @AlanBateman's approval too.) ------------- Marked as reviewed by vyazici (Committer). PR Review: https://git.openjdk.org/jdk/pull/26966#pullrequestreview-3163749316 From dclarke at openjdk.org Thu Aug 28 08:51:14 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Thu, 28 Aug 2025 08:51:14 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: References: Message-ID: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> > This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. > > These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. > > I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: - fixed copyright header - merged master into branch - moved repeating code into own method - implementing feedback, adding missing errno checks, cleanup - feedback - general cleanup - small refactoring - Performance - implementing feedback - removed unrelated change - ... and 2 more: https://git.openjdk.org/jdk/compare/7150100e...cc5f558a ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25546/files - new: https://git.openjdk.org/jdk/pull/25546/files/9de0789e..cc5f558a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25546&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25546&range=02-03 Stats: 204841 lines in 4003 files changed: 121501 ins; 55113 del; 28227 mod Patch: https://git.openjdk.org/jdk/pull/25546.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25546/head:pull/25546 PR: https://git.openjdk.org/jdk/pull/25546 From vyazici at openjdk.org Thu Aug 28 10:46:01 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 10:46:01 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v8] In-Reply-To: References: Message-ID: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Improve docs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/584e6e21..fa46a81b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=06-07 Stats: 73 lines in 1 file changed: 52 ins; 5 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Thu Aug 28 10:46:02 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 10:46:02 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v7] In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 23:18:11 GMT, Chen Liang wrote: >> Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: >> >> - Improve "sneaky throws" >> - Improve comment style > > src/java.base/share/classes/java/lang/String.java line 890: > >> 888: >> 889: private static byte[] encodeWithEncoder( >> 890: Charset cs, byte coder, byte[] val, Class exceptionClass) > > Since `exceptionClass` is a dummy argument that can't actually control the type of exception thrown by this method, that it being null or not is the only thing that matters, I recommend documenting/commenting about this fact, as this is otherwise potentially confusing. Maybe a name to indicate this nature (I came up with `replacementSwitch` but this is for sure horrible) would help too I guess? I think you have a point ? I've improved the docs in fa46a81bdc2. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2307007890 From alanb at openjdk.org Thu Aug 28 11:52:45 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 11:52:45 GMT Subject: RFR: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException [v2] In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 19:39:17 GMT, Brian Burkhalter wrote: >> Translate a `UnixException` with `errno == ELOOP` to `FileSystemLoopException` instead of the less specific `FileSystemException`. > > Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: > > 8366254: Improve error message for ELOOP Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26966#pullrequestreview-3164529197 From pminborg at openjdk.org Thu Aug 28 12:15:49 2025 From: pminborg at openjdk.org (Per Minborg) Date: Thu, 28 Aug 2025 12:15:49 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: On Thu, 28 Aug 2025 08:51:14 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: > > - fixed copyright header > - merged master into branch > - moved repeating code into own method > - implementing feedback, adding missing errno checks, cleanup > - feedback > - general cleanup > - small refactoring > - Performance > - implementing feedback > - removed unrelated change > - ... and 2 more: https://git.openjdk.org/jdk/compare/45d1c898...cc5f558a Some of the methods in FFMUtils are general and should be available on all platforms. I think we can fix this when we submit the next panamization PR. ------------- Marked as reviewed by pminborg (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25546#pullrequestreview-3164598956 From alanb at openjdk.org Thu Aug 28 12:55:50 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 12:55:50 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v8] In-Reply-To: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> References: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> Message-ID: On Thu, 28 Aug 2025 10:46:01 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve docs src/java.base/share/classes/java/lang/String.java line 1336: > 1334: > 1335: /** > 1336: * {@return a new {@link MalformedInputException} for the sub-range denoted by specified {@code offset} and {@code length}} Some of the very long lines make it hard to look at the changes side-by-side, would you mind trimming some of these back to make it easier for reviewers? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2307325258 From alanb at openjdk.org Thu Aug 28 12:59:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 12:59:46 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v8] In-Reply-To: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> References: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> Message-ID: On Thu, 28 Aug 2025 10:46:01 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve docs src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 392: > 390: * @throws CharacterCodingException For malformed input or unmappable characters > 391: */ > 392: byte[] getBytesUTF8NoReplacement(String s) throws CharacterCodingException; Happy to see this throwing CharacterCodingException as it was very confusing and fragile for the use sites to have to deal with IAE. It would be nice if these methods didn't have to have to "NoReplacement" suffix but you are bridging APIs that deal with coding errors so the verbose name help with that. Note that CodingErrorAction defines this as "REPORT" rather than no-REPLACE. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2307333723 From lkorinth at openjdk.org Thu Aug 28 13:05:51 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 28 Aug 2025 13:05:51 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Fri, 22 Aug 2025 17:18:40 GMT, Phil Race wrote: > > @prrace the change maintains the same absolute timeout value for those tests. Before the default of 120 was multiplied by the timeoutFactor of 4 to given 480. Now the value 480 is multiplied by the timeoutFactor of 1 to give 480. And IIRC Leo only did that for tests that demonstrated a timeout with the new default settings (120*1). It is not practical for Leo to investigate every changed test to see if it could get away with a value between 120 and 480. The change just maintains the status quo. Test owners are free to investigate further if they think it worth fine tuning these values. > > I don't agree. If you are going to modify individual tests, you need to demonstrate what you did for that test is justified or don't do it. > > I am also questioning whether such a time out was demonstrated for this test. I've searched the entire history of CI jobs and I don't see where Leo had such a timeout of this test. I can send you my query off-line so you can check it. Maybe it is incomplete. I will revert this change. Thanks for finding it. I think the timeout was found in a local run with a timeout factor of 0.5 and a local fix to "CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE". CI history tells me that the run time of the test is stable and that we have a margin. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2307351823 From alanb at openjdk.org Thu Aug 28 13:05:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 13:05:52 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v8] In-Reply-To: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> References: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> Message-ID: On Thu, 28 Aug 2025 10:46:01 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve docs src/java.base/share/classes/java/lang/String.java line 884: > 882: } > 883: > 884: private static byte[] encodeWithEncoderNoReplacement(Charset cs, byte coder, byte[] val) I wonder if we should rename this to encodeNoReplacement while we are here because "WithEncoder" suggests it takes an encoder, which isn't the case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2307352042 From lkorinth at openjdk.org Thu Aug 28 13:12:45 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 28 Aug 2025 13:12:45 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v6] In-Reply-To: References: Message-ID: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with two additional commits since the last revision: - revert added timeout, it is not needed - feedback from Mark Sheppard ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/f24a1e72..365454d2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=04-05 Stats: 62 lines in 41 files changed: 3 ins; 0 del; 59 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From lkorinth at openjdk.org Thu Aug 28 13:12:46 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 28 Aug 2025 13:12:46 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 17:05:59 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > update testing.md, remove makefile link, fix bad text I have added some updates. I will try to merge latest, update copyrights and run tests over the weekend. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26749#issuecomment-3233444166 From alanb at openjdk.org Thu Aug 28 13:18:49 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 13:18:49 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v3] In-Reply-To: <2Ba0mtRfzDkeFI0Upbio9CGMeJraWcQ50z-m1TAG9bE=.4d4d0edd-fe22-4a67-b185-68fa6785c797@github.com> References: <2Ba0mtRfzDkeFI0Upbio9CGMeJraWcQ50z-m1TAG9bE=.4d4d0edd-fe22-4a67-b185-68fa6785c797@github.com> Message-ID: <4zpION2LktOQ07ISx6JHEGWOXdE7XGmjodwqCe4YzcY=.8eff5d96-8482-4d33-b256-cf3e33f4d695@github.com> On Wed, 27 Aug 2025 08:44:19 GMT, Per Minborg wrote: >> Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: >> >> moved repeating code into own method > > src/java.base/macosx/classes/sun/nio/ch/KQueuePoller.java line 76: > >> 74: int i = 0; >> 75: while (i < n) { >> 76: MemorySegment eventMS = KQueue.getEvent(pollArray, i); > > Nit: Can we call these variables `eventSegment`? My reptile part of the brain first read "event in milliseconds". Yes, I think rename this to kevent to keventSegemnt as it's a kevent struct (which is why the Unsafe usage named it keventAddres). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307381472 From alanb at openjdk.org Thu Aug 28 13:18:55 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 13:18:55 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: On Thu, 28 Aug 2025 08:51:14 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: > > - fixed copyright header > - merged master into branch > - moved repeating code into own method > - implementing feedback, adding missing errno checks, cleanup > - feedback > - general cleanup > - small refactoring > - Performance > - implementing feedback > - removed unrelated change > - ... and 2 more: https://git.openjdk.org/jdk/compare/025b157a...cc5f558a src/java.base/macosx/classes/sun/nio/ch/KQueuePort.java line 57: > 55: > 56: // address of the poll array passed to kqueue_wait > 57: private final MemorySegment pollArrayRegions; The "Regions" suffix is confusing here? This is the poll array that we invoke kqueue so I don't think "Regions" should be in the name. src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java line 103: > 101: @Override > 102: protected int doSelect(Consumer action, long timeout) > 103: throws IOException I assume you didn't mean to change this (processEvents too). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307385367 PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307386648 From alanb at openjdk.org Thu Aug 28 13:29:50 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 13:29:50 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: On Thu, 28 Aug 2025 08:51:14 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: > > - fixed copyright header > - merged master into branch > - moved repeating code into own method > - implementing feedback, adding missing errno checks, cleanup > - feedback > - general cleanup > - small refactoring > - Performance > - implementing feedback > - removed unrelated change > - ... and 2 more: https://git.openjdk.org/jdk/compare/6924a084...cc5f558a src/java.base/macosx/classes/jdk/internal/ffi/generated/ErrnoUtils.java line 26: > 24: */ > 25: > 26: package jdk.internal.ffi.generated; Using jdk.internal.ffi.generated.** for jextract generated code is good. I'm not sure this is the right place for ErrnoUtils. src/java.base/macosx/classes/jdk/internal/ffi/generated/ErrnoUtils.java line 42: > 40: private static final long ERRNO_STRING_HOLDER_ARRAY_SIZE = 256L; > 41: > 42: public static IOException IOExceptionWithErrnoString(int errno, String message) { The naming is a bit confusing here, minimally need a method description so we can quickly understand the relationship between "message" and strerror(errno). src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 48: > 46: final class KQueue { > 47: > 48: private static final BufferStack POOL = BufferStack.of(timespec.layout()); I think we'll need to rename this to BUFFER_STACK or something better as "POLL" is a bit confusing. src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 91: > 89: */ > 90: static MemorySegment getEvent(MemorySegment memoryHandle, int i) { > 91: return kevent.asSlice(memoryHandle, i); Previous work eliminated allocating from the performance critical usages, might have to check the implications of asSlice here. src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 111: > 109: // -- Native methods -- > 110: > 111: static public int register(int kqfd, int fd, int filter, int flags) { No need to make this public. src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 113: > 111: static public int register(int kqfd, int fd, int filter, int flags) { > 112: int result; > 113: try (Arena arena = Arena.ofConfined()) { The register method is very performance critical (the equivalents on Linux might be called >1M/sec) so need to see the impact of creating a confined arena and allocating. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307400147 PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307403262 PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307408362 PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307411960 PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307414172 PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307419308 From alanb at openjdk.org Thu Aug 28 13:33:53 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 13:33:53 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: On Thu, 28 Aug 2025 08:51:14 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: > > - fixed copyright header > - merged master into branch > - moved repeating code into own method > - implementing feedback, adding missing errno checks, cleanup > - feedback > - general cleanup > - small refactoring > - Performance > - implementing feedback > - removed unrelated change > - ... and 2 more: https://git.openjdk.org/jdk/compare/1fc9f3a2...cc5f558a src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 120: > 118: // rest default to zero > 119: > 120: // this do-while replaces restartable Future maintainers may ask what "replaces restartable" means, I think better to say that it calls kqueue if the syscall is interrupted (EINTR). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2307431006 From alanb at openjdk.org Thu Aug 28 14:01:47 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 28 Aug 2025 14:01:47 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v2] In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 13:20:17 GMT, Darragh Clarke wrote: >> Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision: >> >> implementing feedback, adding missing errno checks, cleanup > > I made a few changes mostly based on comments but I'll give a little patch notes: > > - I'd missed some errno checks for kqueue > - Moved the FFMUtils class from shared to just be in `maxosx`, I also changed how this gets the valueLayouts for C values to match how newer versions of jextract generate this > - I changed how the util method that converts errno codes to their respective error strings > > > I ran this against the selector tests on all OSs and everything seems green after repeated tests @DarraghClarke @minborg Would it be possible to provide a brief summary on what modifications have been done to the jextract-generated classes? The use of FFMUtils jumps out. Ideally they would be checked in without modification as it makes it easy to re-generate. It might be that this never happens but there is something a bit uncomfortable about checking in modified sources. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25546#issuecomment-3233618089 From dclarke at openjdk.org Thu Aug 28 15:05:53 2025 From: dclarke at openjdk.org (Darragh Clarke) Date: Thu, 28 Aug 2025 15:05:53 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: <22V1rYuOtYARMeEUsFkV-SR6ezs4tfvj6K-XE_Lg-qA=.dd66d148-f759-47f3-8e86-f9c45cd43a20@github.com> On Thu, 28 Aug 2025 08:51:14 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on the work that was previously shared in https://github.com/openjdk/jdk/pull/22307 , The main change since then is that this branch takes advantage of the changes made in https://github.com/openjdk/jdk/pull/25043 to allow for better performance during errno handling. >> >> These changes feature a lot of Jextract generated files, though alterations have been made in relation to Errno handling and performance improvements. >> >> I will update this description soon to include performance metrics on a few microbenchmarks, though currently it's roughly 2% to 3% slower with the changes, which is somewhat expected, though there are still a few ideas of possible performance improvements that could be tried. Any suggestions or comments in that area are more than welcome however. > > Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: > > - fixed copyright header > - merged master into branch > - moved repeating code into own method > - implementing feedback, adding missing errno checks, cleanup > - feedback > - general cleanup > - small refactoring > - Performance > - implementing feedback > - removed unrelated change > - ... and 2 more: https://git.openjdk.org/jdk/compare/e949c2ca...cc5f558a Thanks for the thorough review, I'll address all these in the next commit. As for the changes to generated code, I'll draft up a list of what changed and why, though FFMUtils in particular came about as trying to move reusable utility methods into a shared place to cut down on code duplication going forward ------------- PR Comment: https://git.openjdk.org/jdk/pull/25546#issuecomment-3233869851 From bpb at openjdk.org Thu Aug 28 15:33:48 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 28 Aug 2025 15:33:48 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software [v2] In-Reply-To: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> References: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> Message-ID: <8a16Xk1iV6JDFDwZG1-MV4HSysb1o9MISlKETOcY4dw=.e8977f84-45e0-4a32-8b9d-c2ac1e8b1bca@github.com> On Thu, 28 Aug 2025 05:55:20 GMT, Aleksey Shipilev wrote: >> This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. >> >> This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. >> >> Additional testing: >> - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately >> - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions >> - [x] Linux AArch64 server fastdebug, test does not fail after 10000x repetitions > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Remove unnecessary changes Still looks fine. ------------- Marked as reviewed by bpb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26961#pullrequestreview-3165428425 From shade at openjdk.org Thu Aug 28 15:33:50 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 28 Aug 2025 15:33:50 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software [v2] In-Reply-To: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> References: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> Message-ID: <7eMwCCfK08CQjqmXa2MX__2i4UWIKLEy0s6H2__O-EA=.90842c9e-4fff-47d7-93b2-04c329040108@github.com> On Thu, 28 Aug 2025 05:55:20 GMT, Aleksey Shipilev wrote: >> This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. >> >> This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. >> >> Additional testing: >> - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately >> - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions >> - [x] Linux AArch64 server fastdebug, test does not fail after 10000x repetitions > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Remove unnecessary changes Another 10000x repetitions with new version completed fine. So I would like to integrate. Looking for second Reviewer :) ------------- PR Comment: https://git.openjdk.org/jdk/pull/26961#issuecomment-3233989541 From bpb at openjdk.org Thu Aug 28 15:40:44 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 28 Aug 2025 15:40:44 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software [v2] In-Reply-To: <7eMwCCfK08CQjqmXa2MX__2i4UWIKLEy0s6H2__O-EA=.90842c9e-4fff-47d7-93b2-04c329040108@github.com> References: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> <7eMwCCfK08CQjqmXa2MX__2i4UWIKLEy0s6H2__O-EA=.90842c9e-4fff-47d7-93b2-04c329040108@github.com> Message-ID: On Thu, 28 Aug 2025 15:31:32 GMT, Aleksey Shipilev wrote: >> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove unnecessary changes > > Another 10000x repetitions with new version completed fine. So I would like to integrate. Looking for second Reviewer :) @shipilev Reviewer count decremented; ready to go. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26961#issuecomment-3234010070 From shade at openjdk.org Thu Aug 28 16:01:50 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 28 Aug 2025 16:01:50 GMT Subject: Integrated: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 14:05:14 GMT, Aleksey Shipilev wrote: > This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. > > This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. > > Additional testing: > - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately > - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions > - [x] Linux AArch64 server fastdebug, test does not fail after 10000x repetitions This pull request has now been integrated. Changeset: 8c6d1225 Author: Aleksey Shipilev URL: https://git.openjdk.org/jdk/commit/8c6d12250b524c0f4ee25dbbc6fe959581b7617b Stats: 107 lines in 2 files changed: 67 ins; 23 del; 17 mod 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software Reviewed-by: bpb ------------- PR: https://git.openjdk.org/jdk/pull/26961 From shade at openjdk.org Thu Aug 28 16:01:49 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 28 Aug 2025 16:01:49 GMT Subject: RFR: 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software [v2] In-Reply-To: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> References: <2zxInf_iGBCClwHnXO7Sj0l2r9gt97U8XdglXDL2hb0=.f31b1246-3b8b-4c25-b3e9-269a8f2bb717@github.com> Message-ID: On Thu, 28 Aug 2025 05:55:20 GMT, Aleksey Shipilev wrote: >> This test routinely fails on our instances that have AV software enabled: that software apparently reads the file in background on access, which trips the very sensitive "is file in cache" test. It looks like there is a reliable way to mitigate this by keeping the file open, and attempting the (read|write)+check several times, with cache flush in between. >> >> This is not perfect, but works in practice. Second attempt seems to work in >99% of the cases, we are doing 3 attempts to make test extra reliable. >> >> Additional testing: >> - [x] Linux AArch64 server fastdebug; sensitivity check: dropped `DIRECT` from the test, test starts failing immediately >> - [x] Linux AArch64 server fastdebug, test does not fail after 100x repetitions >> - [x] Linux AArch64 server fastdebug, test does not fail after 10000x repetitions > > Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision: > > Remove unnecessary changes Thanks! Here goes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26961#issuecomment-3234073486 From bpb at openjdk.org Thu Aug 28 17:40:51 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Thu, 28 Aug 2025 17:40:51 GMT Subject: Integrated: 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException In-Reply-To: References: Message-ID: <5d0qWRYl3VQ2RN4_dCLfE-Y8v53Xh_i4n_WtszWsWG4=.c48799b7-79a5-48fd-ae1b-e3944f363d4a@github.com> On Wed, 27 Aug 2025 17:50:13 GMT, Brian Burkhalter wrote: > Translate a `UnixException` with `errno == ELOOP` to `FileSystemLoopException` instead of the less specific `FileSystemException`. This pull request has now been integrated. Changeset: aaac8c06 Author: Brian Burkhalter URL: https://git.openjdk.org/jdk/commit/aaac8c0636e12c40c46170bf4989bd34bb577430 Stats: 9 lines in 2 files changed: 3 ins; 0 del; 6 mod 8366254: (fs) UnixException.translateToIOException should translate ELOOP to FileSystemLoopException Reviewed-by: vyazici, alanb ------------- PR: https://git.openjdk.org/jdk/pull/26966 From vyazici at openjdk.org Thu Aug 28 19:25:10 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 19:25:10 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v9] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: - Rename `NoReplacement` suffix to `OrThrow` - Simplify `encodeWithEncoder` and trim long lines ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/fa46a81b..14c0391a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=07-08 Stats: 223 lines in 8 files changed: 93 ins; 94 del; 36 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Thu Aug 28 19:25:11 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 19:25:11 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v8] In-Reply-To: References: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> Message-ID: On Thu, 28 Aug 2025 12:52:41 GMT, Alan Bateman wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Improve docs > > src/java.base/share/classes/java/lang/String.java line 1336: > >> 1334: >> 1335: /** >> 1336: * {@return a new {@link MalformedInputException} for the sub-range denoted by specified {@code offset} and {@code length}} > > Some of the very long lines make it hard to look at the changes side-by-side, would you mind trimming some of these back to make it easier for reviewers? Changed as requested in 978d981039a ? let me know if I've missed any. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2308332349 From vyazici at openjdk.org Thu Aug 28 19:30:48 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 19:30:48 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v8] In-Reply-To: References: <306PXhV2VddqIGZwDJnm0k3Xy5Lp4FL4fZr5VzUVfQc=.0d5225ca-5671-4020-a334-c6c7b366f3cf@github.com> Message-ID: On Thu, 28 Aug 2025 13:02:51 GMT, Alan Bateman wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Improve docs > > src/java.base/share/classes/java/lang/String.java line 884: > >> 882: } >> 883: >> 884: private static byte[] encodeWithEncoderNoReplacement(Charset cs, byte coder, byte[] val) > > I wonder if we should rename this to encodeNoReplacement while we are here because "WithEncoder" suggests it takes an encoder, which isn't the case. In 978d981039a, I did something else, which I believe also addresses your concern: removed the two `encodeWithEncoder()` and `encodeWithEncoderNoReplacement()` methods. Each were called from only one place, hence, simply inlined these calls. > src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 392: > >> 390: * @throws CharacterCodingException For malformed input or unmappable characters >> 391: */ >> 392: byte[] getBytesUTF8NoReplacement(String s) throws CharacterCodingException; > > Happy to see this throwing CharacterCodingException as it was very confusing and fragile for the use sites to have to deal with IAE. It would be nice if these methods didn't have to have to "NoReplacement" suffix but you are bridging APIs that deal with coding errors so the verbose name help with that. Note that CodingErrorAction defines this as "REPORT" rather than no-REPLACE. Agreed with your remark on naming. I find the negation in the `NoReplacement` very confusing ? consider places doubling this negation. :melting_face: Renamed `NoReplacement` suffix to `OrThrow` in 14c0391a3aa. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2308338856 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2308342544 From vyazici at openjdk.org Thu Aug 28 19:43:44 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 28 Aug 2025 19:43:44 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v9] In-Reply-To: References: Message-ID: On Mon, 21 Jul 2025 13:00:03 GMT, Chen Liang wrote: >> Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: >> >> - Rename `NoReplacement` suffix to `OrThrow` >> - Simplify `encodeWithEncoder` and trim long lines > > src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 328: > >> 326: * @throws CharacterCodingException for malformed or unmappable bytes >> 327: */ >> 328: String uncheckedNewString(byte[] bytes, Charset cs) throws CharacterCodingException; > > The docs should mention these two details: > 1. This method does not replace upon malformed data but fails > 2. This method does not copy the byte array for validation (can add to the warning) Confirmed with @liach that his remarks are addressed ? resolving this conversation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2308371942 From alanb at openjdk.org Fri Aug 29 06:51:51 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 29 Aug 2025 06:51:51 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v9] In-Reply-To: References: Message-ID: On Thu, 28 Aug 2025 19:25:10 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Rename `NoReplacement` suffix to `OrThrow` > - Simplify `encodeWithEncoder` and trim long lines src/java.base/share/classes/java/lang/String.java line 707: > 705: * @throws CharacterCodingException for malformed input or unmappable characters > 706: */ > 707: private static String newStringUTF8OrThrow(byte[] bytes, int offset, int length) Renaming to the OrThrow suffix is good, that really helps the use-sites, the far away ones in particular. src/java.base/share/classes/java/lang/String.java line 1434: > 1432: * having to declare the exception > 1433: */ > 1434: private static byte[] encodeUTF8_UTF16(byte[] val, Class exceptionClass) throws E { Would it be possible to add a brief method description to this method? It's the equivalent of decoding val with the UTF-8 charset, then encoding the result with the UTF-16 charset, right? In passing, if rename exceptionClass to exClass then you'll get get some back some of the horizontal space in several areas. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2309311930 PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2309310126 From vyazici at openjdk.org Fri Aug 29 13:48:52 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 29 Aug 2025 13:48:52 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v10] In-Reply-To: References: Message-ID: > `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: - Improve Javadoc of touched `encode*()` methods - Rename `exceptionClass` to `exClass` ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26413/files - new: https://git.openjdk.org/jdk/pull/26413/files/14c0391a..dae04e9e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26413&range=08-09 Stats: 70 lines in 1 file changed: 24 ins; 2 del; 44 mod Patch: https://git.openjdk.org/jdk/pull/26413.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26413/head:pull/26413 PR: https://git.openjdk.org/jdk/pull/26413 From vyazici at openjdk.org Fri Aug 29 13:48:54 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 29 Aug 2025 13:48:54 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v9] In-Reply-To: References: Message-ID: On Fri, 29 Aug 2025 06:48:00 GMT, Alan Bateman wrote: >> Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: >> >> - Rename `NoReplacement` suffix to `OrThrow` >> - Simplify `encodeWithEncoder` and trim long lines > > src/java.base/share/classes/java/lang/String.java line 1434: > >> 1432: * having to declare the exception >> 1433: */ >> 1434: private static byte[] encodeUTF8_UTF16(byte[] val, Class exceptionClass) throws E { > > Would it be possible to add a brief method description to this method? It's the equivalent of decoding val with the UTF-16 charset, then encoding the result with the UTF-8 charset, right? > > In passing, if rename exceptionClass to exClass then you'll get get some back some of the horizontal space in several areas. Pushed following changes: - dae04e9e35e Improve Javadoc of touched `encode*()` methods - b120d14fd96 Rename `exceptionClass` to `exClass` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2310204987 From lkorinth at openjdk.org Fri Aug 29 14:41:48 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 29 Aug 2025 14:41:48 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v6] In-Reply-To: References: Message-ID: On Tue, 26 Aug 2025 17:06:08 GMT, Matthew Donovan wrote: >> Leo Korinth has updated the pull request incrementally with two additional commits since the last revision: >> >> - revert added timeout, it is not needed >> - feedback from Mark Sheppard > > test/jdk/sun/security/krb5/name/Constructors.java line 28: > >> 26: * @summary Make PrincipalName and Realm immutable >> 27: * @modules java.security.jgss/sun.security.krb5 >> 28: * @run main/othervm Constructors > > Do you know why this test needs the change? It's not doing much (no blocking calls) and on my system runs in about a tenth of a second. I have not analysed why. I can see 1013 occurrences in our test history where the test takes 2 minutes or more. On different CPU platforms. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2310355659 From pminborg at openjdk.org Fri Aug 29 14:52:58 2025 From: pminborg at openjdk.org (Per Minborg) Date: Fri, 29 Aug 2025 14:52:58 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: On Thu, 28 Aug 2025 13:24:30 GMT, Alan Bateman wrote: >> Darragh Clarke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: >> >> - fixed copyright header >> - merged master into branch >> - moved repeating code into own method >> - implementing feedback, adding missing errno checks, cleanup >> - feedback >> - general cleanup >> - small refactoring >> - Performance >> - implementing feedback >> - removed unrelated change >> - ... and 2 more: https://git.openjdk.org/jdk/compare/c00c2dcb...cc5f558a > > src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 91: > >> 89: */ >> 90: static MemorySegment getEvent(MemorySegment memoryHandle, int i) { >> 91: return kevent.asSlice(memoryHandle, i); > > Previous work eliminated allocating from the performance critical usages, might have to check the implications of asSlice here. We could use indices/offsets directly in the methods that receive the slices from this method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2310386763 From lkorinth at openjdk.org Fri Aug 29 18:45:45 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 29 Aug 2025 18:45:45 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v7] In-Reply-To: References: Message-ID: <2IfOGWu0Kfw8qdRmYLkMEdF5kvlC5lcuc-USAovOTFM=.f6d2a6c9-160d-478e-aa5c-1086b40e52bd@github.com> > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: update copyright ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/365454d2..4b33904a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=05-06 Stats: 233 lines in 233 files changed: 0 ins; 0 del; 233 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From alanb at openjdk.org Sat Aug 30 14:04:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 30 Aug 2025 14:04:46 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v10] In-Reply-To: References: Message-ID: On Fri, 29 Aug 2025 13:48:52 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Improve Javadoc of touched `encode*()` methods > - Rename `exceptionClass` to `exClass` Thanks for the updates, I don't have any more comments. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3171050605 From liach at openjdk.org Sat Aug 30 14:17:45 2025 From: liach at openjdk.org (Chen Liang) Date: Sat, 30 Aug 2025 14:17:45 GMT Subject: RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v10] In-Reply-To: References: Message-ID: On Fri, 29 Aug 2025 13:48:52 GMT, Volkan Yazici wrote: >> `NoRepl`-suffixed `String` methods denote methods that do not replace invalid characters, but throw `CharacterCodingException` on encounter. This behavior cannot easily be derived from the method footprints, has been a source of confusion for maintainers, and is not uniformly adopted, e.g., `newStringUTF8NoRepl()` and `getBytesUTF8NoRepl()` does *not* throw `CCE`. This PR replaces the `NoRepl` suffix with `NoReplacement` in method names and consistently uses `throws CCE` in method footprints. > > Volkan Yazici has updated the pull request incrementally with two additional commits since the last revision: > > - Improve Javadoc of touched `encode*()` methods > - Rename `exceptionClass` to `exClass` The new `OrThrow` name is much better! ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26413#pullrequestreview-3171057352 From alanb at openjdk.org Sat Aug 30 14:31:43 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 30 Aug 2025 14:31:43 GMT Subject: RFR: 8356493: (fs) SecureDirectoryStream missing some capabilities In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 00:07:38 GMT, Brian Burkhalter wrote: > Add several methods to `java.nio.file.SecureDirectoryStream`. src/java.base/share/classes/java/nio/file/SecureDirectoryStream.java line 141: > 139: * Creates a new and empty file, failing if the file already exists. > 140: * > 141: *

    This method works in a similar manner to {@linkplain Files#createFile I think this method can use "This method works in exactly the manner specified". src/java.base/share/classes/java/nio/file/SecureDirectoryStream.java line 171: > 169: * @since 26 > 170: */ > 171: Path createFile(Path path, FileAttribute... attrs) I assume the parameter should be of type T (same comment on the other methods) src/java.base/share/classes/java/nio/file/SecureDirectoryStream.java line 250: > 248: */ > 249: Path createLink(T link, SecureDirectoryStream targetdir, T existing) > 250: throws IOException; I realize this models a pair of dfd/path tuples and mklinkat but I wonder about the usability and whether we really need this. In other, maybe we should drop this method from the proposal for now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26950#discussion_r2311960667 PR Review Comment: https://git.openjdk.org/jdk/pull/26950#discussion_r2311963818 PR Review Comment: https://git.openjdk.org/jdk/pull/26950#discussion_r2311964305 From alanb at openjdk.org Sat Aug 30 15:07:44 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 30 Aug 2025 15:07:44 GMT Subject: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v4] In-Reply-To: References: <-sJZGmlwKVOGrdCEe4Wqx5Hvig4q3ow1RKDa1n8uhKA=.bb2fb3c5-53ed-44bc-b268-8ac01327aee5@github.com> Message-ID: <5134m5ttzdbgrrPBJLbQLC9TsZ8-MyIg9Ky1Js2pMZ4=.f44a3a5d-1c75-4b76-98a8-3344cac98e2d@github.com> On Fri, 29 Aug 2025 14:50:29 GMT, Per Minborg wrote: >> src/java.base/macosx/classes/sun/nio/ch/KQueue.java line 91: >> >>> 89: */ >>> 90: static MemorySegment getEvent(MemorySegment memoryHandle, int i) { >>> 91: return kevent.asSlice(memoryHandle, i); >> >> Previous work eliminated allocating from the performance critical usages, might have to check the implications of asSlice here. > > We could use indices/offsets directly in the methods that receive the slices from this method. `getDescriptor(MemorySegment keventArray, int index)` and `getFilter(MemorySegment keventArray, int index)` would work for the use-sites. The other thing here is that a fd is an int rather than a long. The re-implemented KQueue should pick ident or fd (the common usage). Right now register takes an int fd, where the modified getDescriptor is actually returning the 64-bit ident. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25546#discussion_r2311977307