From myankelevich at openjdk.org Sat Nov 1 10:09:12 2025 From: myankelevich at openjdk.org (Mikhail Yankelevich) Date: Sat, 1 Nov 2025 10:09:12 GMT Subject: Integrated: 8368625: com/sun/net/httpserver/ServerStopTerminationTest.java fails intermittently In-Reply-To: References: Message-ID: On Tue, 7 Oct 2025 10:11:22 GMT, Mikhail Yankelevich wrote: > I believe that increasing the timeout might help, as it seems to be happening due to the machine load. I'm going to make a pr increasing the timeout to 20 from 5 (similar to what it was when timeout factor was 4). This pull request has now been integrated. Changeset: 13b3d2fc Author: Mikhail Yankelevich URL: https://git.openjdk.org/jdk/commit/13b3d2fca1af71d0aa9908e19630c2e965dd7134 Stats: 26 lines in 1 file changed: 10 ins; 11 del; 5 mod 8368625: com/sun/net/httpserver/ServerStopTerminationTest.java fails intermittently Reviewed-by: dfuchs ------------- PR: https://git.openjdk.org/jdk/pull/27670 From duke at openjdk.org Sat Nov 1 10:27:02 2025 From: duke at openjdk.org (Peyang) Date: Sat, 1 Nov 2025 10:27:02 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v6] In-Reply-To: References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: On Fri, 31 Oct 2025 14:45:18 GMT, Daniel Fuchs wrote: >> I recall reading this part of the RFC before. >> Since it says *MAY*, and given that this is a simple web server, I wasn't sure if such validations are strictly required, >> so I didn't implement them. >> But if you think it's necessary, I can add them now. > > Yes please. I'd prefer to have built-in validation. I implemented a check that validates whether the ranges are in ascendnig order and non-overlapping, returning an error if they are not. However, I have some concerns: this restriction might be too strict. Instead of outright rejecting requests with overlapping or unsorted ranges, what if the server simply combines overlapping ranges and sorts them before returning? According to [RFC 7233 ?15.3.7.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.7.2-4): > When multiple ranges are requested, a server **MAY** coalesce any of the ranges that overlap, or that are separated by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the corresponding range-spec appeared in the received [Range](https://www.rfc-editor.org/rfc/rfc9110.html#field.range) header field. In other words, rather than strictly validating and rejecting, we could treat this as an efficiency optimization on the server side. I think this approach would be more practical. I?d like to hear your thoughts on this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2483528850 From duke at openjdk.org Sat Nov 1 14:26:27 2025 From: duke at openjdk.org (Peyang) Date: Sat, 1 Nov 2025 14:26:27 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v8] In-Reply-To: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: > Hi all, > > [JEP 408](https://openjdk.org/jeps/408) introduced the Simple Web Server in Java 18, providing a minimal webserver for serving static files over HTTP. > > [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-range-requests) defines "Range Requests" as an optional feature that allows clients to request a subset of a resource's content. Supporting Range requests in the context of JDK's Simple Web Server means enabling the server to serve only the requested portion of a static file. > > This change contains: > > 1. Enhances `sun.net.httpserver.simpleserver.FileServerHandler` in the `jdk.httpserver` module to support `Range` and `If-Range` headers. > 2. Calculates an `ETag` for each resource based on its last-modified date and file size and sends it to the client on demand for use with the `If-Range` header. > 3. Returns the `Accept-Ranges` header for all file retrievals, and `Content-Range` when a client requests a specific range. > 4. Adds a new constant `HTTP_RANGE_NOT_SATISFIABLE` to the `Codes` class to indicate invalid ranges. > 5. Returns `206 Partial Content` for valid ranges and `416 Range Not Satisfiable` for invalid ranges. > 6. Includes corresponding tests to verify correct behavior. > > This enhancement was motivated by recent discussions on the net-dev mailing list, which requested support for Range requests along with example use cases: https://mail.openjdk.org/pipermail/net-dev/2025-April/026364.html > It was also discussed briefly on the net-dev mailing list: https://mail.openjdk.org/pipermail/net-dev/2025-October/028586.html Peyang has updated the pull request incrementally with one additional commit since the last revision: Allow unlimited splits when parsing HTTP Range header to detect trailing commas ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28021/files - new: https://git.openjdk.org/jdk/pull/28021/files/10872b75..41ebfd45 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=06-07 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28021.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28021/head:pull/28021 PR: https://git.openjdk.org/jdk/pull/28021 From duke at openjdk.org Sat Nov 1 15:43:03 2025 From: duke at openjdk.org (EunHyunsu) Date: Sat, 1 Nov 2025 15:43:03 GMT Subject: RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v2] In-Reply-To: References: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> Message-ID: On Fri, 31 Oct 2025 15:26:19 GMT, Daniel Fuchs wrote: > @Michael-Mc-Mahon I believe this change doesn't require a CSR since it's just fixing an example. > > @ehs208 did you generate `make docs-jdk-api` and verify that the generated API documentation correctly displays the new changes? I built the Javadoc locally using `make docs-jdk-api` and confirmed that the HttpClient example now renders correctly. The `HttpRequest` declaration appears properly before the `send` call, matching the asynchronous example style in the generated docs. image (Attached is a screenshot from the generated docs:) ------------- PR Comment: https://git.openjdk.org/jdk/pull/28084#issuecomment-3476469813 From duke at openjdk.org Sat Nov 1 15:53:01 2025 From: duke at openjdk.org (EunHyunsu) Date: Sat, 1 Nov 2025 15:53:01 GMT Subject: RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v2] In-Reply-To: References: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> Message-ID: On Fri, 31 Oct 2025 12:58:39 GMT, EunHyunsu wrote: >> Fixes JDK-8371009. >> >> The synchronous HttpClient example references `request` without defining it. >> This patch adds a minimal HttpRequest initialization immediately before the >> synchronous example (mirroring the asynchronous snippet) so the example >> compiles and runs as-is. > > EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: > > Apply review suggestion: create client before request in HttpClient example > > @Michael-Mc-Mahon I believe this change doesn't require a CSR since it's just fixing an example. > > @ehs208 did you generate `make docs-jdk-api` and verify that the generated API documentation correctly displays the new changes? > > I built the Javadoc locally using `make docs-jdk-api` and confirmed that the HttpClient example now renders correctly. > > The `HttpRequest` declaration appears properly before the `send` call, matching the asynchronous example style in the generated docs. > > image > (Attached is a screenshot from the generated docs:) Upon checking again, I noticed that the asynchronous example is indented slightly more than the synchronous one. It appears that this difference already existed prior to my patch. Just wanted to confirm whether this is intentional or if we should align the indentation for consistency. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28084#issuecomment-3476475892 From ehs122100 at gmail.com Sat Nov 1 19:14:38 2025 From: ehs122100 at gmail.com (Hyunsu Eun) Date: Sun, 2 Nov 2025 04:14:38 +0900 Subject: Suggestion: Add null message for HttpRequest.Builder POST() Message-ID: Hello, While reviewing the implementation of java.net.http.HttpRequest.Builder, I noticed a small inconsistency in how null arguments are handled. Currently, when calling POST(null), a plain NullPointerException is thrown without any descriptive message. Example: HttpRequest.newBuilder() .uri(URI.create(?https://example.com?)) .POST(null) .build(); This produces the following stack trace: Exception in thread ?main? java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:220) at java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.POST(HttpRequestBuilderImpl.java:180) at org.example.Main.main(Main.java:17) Although the cause can be inferred from Main.java:17, the exception message itself does not clearly indicate which argument was null. In contrast, the uri(URI) method in the same class uses requireNonNull(uri, "uri must be non-null"), which provides a clear and descriptive message when the argument is null. I understand that URI is a mandatory field for every request, while the BodyPublisher might be optional. However, since passing a null body to POST, PUT, or method(String, BodyPublisher) is almost always unintentional, it may be helpful to include a similar message for these methods as well. For example, requireNonNull(body, "BodyPublisher must be non-null"); Adding such a message would improve clarity and consistency with other null checks already present in this class. I have searched for existing issues related to this behavior but was unable to find any. If I have overlooked something or if this suggestion is inappropriate, please feel free to let me know. If the proposal sounds reasonable, I would be happy to prepare a patch and contribute it. Thank you for your time and consideration. Best regards, Hyunsu Eun GitHub: https://github.com/ehs208 From jaikiran.pai at oracle.com Sun Nov 2 05:37:32 2025 From: jaikiran.pai at oracle.com (Jaikiran Pai) Date: Sun, 2 Nov 2025 11:07:32 +0530 Subject: Suggestion: Add null message for HttpRequest.Builder POST() In-Reply-To: References: Message-ID: <049b575e-53d0-4a59-81ca-3ccfb462d9f2@oracle.com> This proposal looks reasonable to me. I've filed https://bugs.openjdk.org/browse/JDK-8371091 as an enhancement request and you can raise a PR against that. -Jaikiran On 02/11/25 12:44 am, Hyunsu Eun wrote: > Hello, > > While reviewing the implementation of java.net.http.HttpRequest.Builder, > I noticed a small inconsistency in how null arguments are handled. > > Currently, when calling POST(null), a plain NullPointerException is thrown > without any descriptive message. > > Example: > > HttpRequest.newBuilder() > .uri(URI.create(?https://example.com?)) > .POST(null) > .build(); > > This produces the following stack trace: > > Exception in thread ?main? java.lang.NullPointerException > at java.base/java.util.Objects.requireNonNull(Objects.java:220) > at java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.POST(HttpRequestBuilderImpl.java:180) > at org.example.Main.main(Main.java:17) > > Although the cause can be inferred from Main.java:17, > the exception message itself does not clearly indicate which argument was null. > > In contrast, the uri(URI) method in the same class uses > requireNonNull(uri, "uri must be non-null"), > which provides a clear and descriptive message when the argument is null. > > I understand that URI is a mandatory field for every request, > while the BodyPublisher might be optional. > However, since passing a null body to POST, PUT, or > method(String, BodyPublisher) is almost always unintentional, > it may be helpful to include a similar message for these methods as well. > > For example, > requireNonNull(body, "BodyPublisher must be non-null"); > > Adding such a message would improve clarity and consistency > with other null checks already present in this class. > > I have searched for existing issues related to this behavior > but was unable to find any. > If I have overlooked something or if this suggestion is inappropriate, > please feel free to let me know. > If the proposal sounds reasonable, > I would be happy to prepare a patch and contribute it. > > Thank you for your time and consideration. > Best regards, > Hyunsu Eun > GitHub: https://github.com/ehs208 From duke at openjdk.org Sun Nov 2 07:30:41 2025 From: duke at openjdk.org (EunHyunsu) Date: Sun, 2 Nov 2025 07:30:41 GMT Subject: RFR: 8371091: Enhance npe message httprequest Message-ID: This change adds clearer NullPointerException messages to the POST(), PUT(), and method() methods in HttpRequest.Builder when the provided BodyPublisher is null. Each of these methods now calls requireNonNull(body, "BodyPublisher must not be null"), making the exception message explicit. A corresponding regression test (RequestBuilderNullBodyTest) has been added to verify this behavior. All builds and related tests (jdk/java/net/httpclient) have passed successfully. Currently, only POST(), PUT(), and method() include these messages. Some other builder methods (such as header(), setHeader(), and uri()) also throw NullPointerException without a message. I would like to discuss whether adding consistent messages to those methods would be beneficial, and whether the current wording "BodyPublisher must not be null" feels appropriate. ------------- Commit messages: - 8271091: fixed whitespace errors - 8271091: Add test verifying NullPointerException messages for null BodyPublisher in HttpRequest.Builder - 8271091: Add descriptive NullPointerException messages for null BodyPublisher in HttpRequest.Builder methods Changes: https://git.openjdk.org/jdk/pull/28103/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371091 Stats: 62 lines in 2 files changed: 59 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/28103.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28103/head:pull/28103 PR: https://git.openjdk.org/jdk/pull/28103 From duke at openjdk.org Sun Nov 2 14:16:37 2025 From: duke at openjdk.org (Peyang) Date: Sun, 2 Nov 2025 14:16:37 GMT Subject: RFR: 8371092: NullPointerException in AltServiceUsageTest.afterClass() test Message-ID: - Add `safeClose(DatagramChannel)` to close udpNotResponding safely. - Null-check and exception handling unified with `safeStop()`. - Ensures test cleanup never fails due to uninitialized or problematic channel. ------------- Commit messages: - 8371092: Avoid NPE in SimpleHttpsServerTest afterClass Changes: https://git.openjdk.org/jdk/pull/28104/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28104&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371092 Stats: 14 lines in 1 file changed: 13 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28104.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28104/head:pull/28104 PR: https://git.openjdk.org/jdk/pull/28104 From duke at openjdk.org Sun Nov 2 17:08:03 2025 From: duke at openjdk.org (Florent Guillaume) Date: Sun, 2 Nov 2025 17:08:03 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v8] In-Reply-To: References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: On Sat, 1 Nov 2025 14:26:27 GMT, Peyang wrote: >> Hi all, >> >> [JEP 408](https://openjdk.org/jeps/408) introduced the Simple Web Server in Java 18, providing a minimal webserver for serving static files over HTTP. >> >> [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-range-requests) defines "Range Requests" as an optional feature that allows clients to request a subset of a resource's content. Supporting Range requests in the context of JDK's Simple Web Server means enabling the server to serve only the requested portion of a static file. >> >> This change contains: >> >> 1. Enhances `sun.net.httpserver.simpleserver.FileServerHandler` in the `jdk.httpserver` module to support `Range` and `If-Range` headers. >> 2. Calculates an `ETag` for each resource based on its last-modified date and file size and sends it to the client on demand for use with the `If-Range` header. >> 3. Returns the `Accept-Ranges` header for all file retrievals, and `Content-Range` when a client requests a specific range. >> 4. Adds a new constant `HTTP_RANGE_NOT_SATISFIABLE` to the `Codes` class to indicate invalid ranges. >> 5. Returns `206 Partial Content` for valid ranges and `416 Range Not Satisfiable` for invalid ranges. >> 6. Includes corresponding tests to verify correct behavior. >> >> This enhancement was motivated by recent discussions on the net-dev mailing list, which requested support for Range requests along with example use cases: https://mail.openjdk.org/pipermail/net-dev/2025-April/026364.html >> It was also discussed briefly on the net-dev mailing list: https://mail.openjdk.org/pipermail/net-dev/2025-October/028586.html > > Peyang has updated the pull request incrementally with one additional commit since the last revision: > > Allow unlimited splits when parsing HTTP Range header to detect trailing commas Changes requested by efge at github.com (no known OpenJDK username). src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/FileServerHandler.java line 344: > 342: try { > 343: if (startStr.isEmpty()) { // "-" > 344: long suffixLength = Long.parseLong(endStr, 10); `Long.parseLong(endStr)` already parses in base 10, there's no need to be explicit about it. See the JDK code: public static long parseLong(String s) throws NumberFormatException { return parseLong(s, 10); } test/jdk/com/sun/net/httpserver/simpleserver/FileServerHandlerTest.java line 147: > 145: > 146: // malformed numbers or format > 147: {"bytes=-0"}, {"bytes=meow"}, {"bytes=--500"}, {"bytes=500"}, {"bytes=-"}, {"bytes=+500-600"}, Please add a test for `bytes=400--500` which uses a code path not covered by existing tests. Also worth adding `bytes=500-+600` and variations with `+` in all possible positions, and omitting left part. Add also `bytes=--`, `bytes=-+1`, ... I'm sure one could come up with more. ------------- PR Review: https://git.openjdk.org/jdk/pull/28021#pullrequestreview-3408865320 PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2484900851 PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2484909654 From vyazici at openjdk.org Mon Nov 3 10:09:29 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 10:09:29 GMT Subject: RFR: 8366575: Remove SDP support In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 17:23:28 GMT, Daniel Fuchs wrote: > The only other mention of sdp I could find in the sources and test is in `ct.properties` @dfuch, `ct.properties` is used by `javac -source 8`, and hence, should not be updated. Nevertheless, good that you raised this detail. I've created [JDK-8371133](https://bugs.openjdk.org/browse/JDK-8371133) to demystify it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28012#issuecomment-3479757650 From michaelm at openjdk.org Mon Nov 3 10:14:30 2025 From: michaelm at openjdk.org (Michael McMahon) Date: Mon, 3 Nov 2025 10:14:30 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v6] In-Reply-To: References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> <9dX_Pl6xcwpO1YgLTj_L3qkGj_Dgrbo3VS3iiztbejo=.bdd88636-83dd-44cf-8edc-c4f8fcfa1ca4@github.com> Message-ID: On Fri, 31 Oct 2025 15:15:22 GMT, Peyang wrote: >> I'll have to check the RFC but it might be allowable to return a shorter range than was requested, but the actual range to be returned would have to have been specified in the `Content-Range` header. You would have to check the length of the file first. So, EOF wouldn't occur except in very unusual circumstances. Otherwise, yes throwing IOE would close the connection signaling the error. > > The `ranges` list in the arguments is constructed so that each range's end option does not exceed the file size: if a requested range goes beyond the file lengh, it is clamped accordingly. > Therefore, I don't think any foundamental change is needed here. > > We could add an `assert` (and a comment) to make this assumption explict, or possibly throw an IOE in case the file was truncated or modified during sending. I definitely don't want code that allows a `Content-Range: bytes 1000-2000` to be written and treated as normal if the file hits EOF 10 bytes short. Even if the situation cannot arise due to higher level checks, I'd like to see IOE thrown rather than breaking from the loop. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2485957717 From duke at openjdk.org Mon Nov 3 10:06:45 2025 From: duke at openjdk.org (Peyang) Date: Mon, 3 Nov 2025 10:06:45 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v9] In-Reply-To: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: > Hi all, > > [JEP 408](https://openjdk.org/jeps/408) introduced the Simple Web Server in Java 18, providing a minimal webserver for serving static files over HTTP. > > [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-range-requests) defines "Range Requests" as an optional feature that allows clients to request a subset of a resource's content. Supporting Range requests in the context of JDK's Simple Web Server means enabling the server to serve only the requested portion of a static file. > > This change contains: > > 1. Enhances `sun.net.httpserver.simpleserver.FileServerHandler` in the `jdk.httpserver` module to support `Range` and `If-Range` headers. > 2. Calculates an `ETag` for each resource based on its last-modified date and file size and sends it to the client on demand for use with the `If-Range` header. > 3. Returns the `Accept-Ranges` header for all file retrievals, and `Content-Range` when a client requests a specific range. > 4. Adds a new constant `HTTP_RANGE_NOT_SATISFIABLE` to the `Codes` class to indicate invalid ranges. > 5. Returns `206 Partial Content` for valid ranges and `416 Range Not Satisfiable` for invalid ranges. > 6. Includes corresponding tests to verify correct behavior. > > This enhancement was motivated by recent discussions on the net-dev mailing list, which requested support for Range requests along with example use cases: https://mail.openjdk.org/pipermail/net-dev/2025-April/026364.html > It was also discussed briefly on the net-dev mailing list: https://mail.openjdk.org/pipermail/net-dev/2025-October/028586.html Peyang has updated the pull request incrementally with three additional commits since the last revision: - Add additional test cases for invalid HTTP Range header formats - Refactor parsing of HTTP Range header to remove radix specification in Long.parseLong calls - Add assertion to ensure end range value valid in HTTP Range header processing ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28021/files - new: https://git.openjdk.org/jdk/pull/28021/files/41ebfd45..83b1a2b4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=07-08 Stats: 17 lines in 2 files changed: 5 ins; 3 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/28021.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28021/head:pull/28021 PR: https://git.openjdk.org/jdk/pull/28021 From vyazici at openjdk.org Mon Nov 3 10:56:40 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 10:56:40 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v3] In-Reply-To: References: Message-ID: > Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Simplify exception handling in `Deadline::between` Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com> ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27973/files - new: https://git.openjdk.org/jdk/pull/27973/files/856aea73..31b49b78 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=01-02 Stats: 9 lines in 1 file changed: 0 ins; 5 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27973.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27973/head:pull/27973 PR: https://git.openjdk.org/jdk/pull/27973 From dfuchs at openjdk.org Mon Nov 3 10:59:04 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 10:59:04 GMT Subject: RFR: 8371092: NullPointerException in AltServiceUsageTest.afterClass() test In-Reply-To: References: Message-ID: On Sun, 2 Nov 2025 14:09:28 GMT, Peyang wrote: > - Add `safeClose(DatagramChannel)` to close udpNotResponding safely. > - Null-check and exception handling unified with `safeStop()`. > - Ensures test cleanup never fails due to uninitialized or problematic channel. Please make sure to run the test locally before integrating. Networking tests are not run by github actions. ------------- Marked as reviewed by dfuchs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28104#pullrequestreview-3410460082 From vyazici at openjdk.org Mon Nov 3 10:59:45 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 10:59:45 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v4] In-Reply-To: References: Message-ID: > Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. 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 six additional commits since the last revision: - Merge remote-tracking branch 'upstream/master' into bigDuration - Simplify exception handling in `Deadline::between` Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com> - Move `delta == 0` in `until()` to the catch block - Add `DeadlineOverflowTest` - Fix duration overflows - Add `DurationOverflowTest` ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27973/files - new: https://git.openjdk.org/jdk/pull/27973/files/31b49b78..970754a7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=02-03 Stats: 56058 lines in 676 files changed: 29516 ins; 22197 del; 4345 mod Patch: https://git.openjdk.org/jdk/pull/27973.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27973/head:pull/27973 PR: https://git.openjdk.org/jdk/pull/27973 From duke at openjdk.org Mon Nov 3 11:12:33 2025 From: duke at openjdk.org (serhiysachkov) Date: Mon, 3 Nov 2025 11:12:33 GMT Subject: RFR: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException Message-ID: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException ------------- Commit messages: - 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException Changes: https://git.openjdk.org/jdk/pull/28108/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28108&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8361106 Stats: 10 lines in 1 file changed: 2 ins; 5 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/28108.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28108/head:pull/28108 PR: https://git.openjdk.org/jdk/pull/28108 From vyazici at openjdk.org Mon Nov 3 11:36:44 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 11:36:44 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v6] In-Reply-To: References: Message-ID: > Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. > > ### Review guidelines > > 1. Read _"the fix"_ in `MultiExchange` > 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` > 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 27 commits: - Merge remote-tracking branch 'upstream/master' into respBodyTime - Improve `HttpBodySubscriberWrapper::onTermination` JavaDoc - Mark `SubscriptionWrapper` as `final` - Replace wrapper's `preTerminationCallback` argument with a method to be extended - Fix `HttpClient` doc typo - Invoke `preTerminationCallback` at `cancel()` too - Move `preTerminationCallback` to `complete()` - Improve docs as suggested by Rajan - Merge remote-tracking branch 'upstream/master' into respBodyTime - Fix code typo - ... and 17 more: https://git.openjdk.org/jdk/compare/667744c3...1601a185 ------------- Changes: https://git.openjdk.org/jdk/pull/27469/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27469&range=05 Stats: 852 lines in 12 files changed: 841 ins; 5 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27469.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27469/head:pull/27469 PR: https://git.openjdk.org/jdk/pull/27469 From vyazici at openjdk.org Mon Nov 3 11:36:48 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 11:36:48 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v5] In-Reply-To: References: Message-ID: On Thu, 30 Oct 2025 14:43:36 GMT, Daniel Fuchs wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Replace wrapper's `preTerminationCallback` argument with a method to be extended > > src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java line 79: > >> 77: * A callback to be invoked before termination, whether due to the >> 78: * completion or failure of the subscriber, or cancellation of the >> 79: * subscription. > > I'd suggest to also say that when a subscription is cancelled, onTermination() is called before onCancel(). Improved docs in 7c989980e19. > src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java line 102: > >> 100: } finally { >> 101: if (markCancelled()) { >> 102: onTermination(); > > I was wondering if it would be better to have the subclasses call the appropriate method from `onCancel()` rather than have both `cancel()` and `complete()` call `onTermination()`. > However - thinking about it again, I believe that calling onTermination() from cancel() is the right call. > > FWIW - we should also make the private class `SubscriptionWrapper` final. Marked `SubscriptionWrapper` as `final` in 02d2b5468e9. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486158926 PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486159462 From davidalayachew at gmail.com Sun Nov 2 22:05:12 2025 From: davidalayachew at gmail.com (David Alayachew) Date: Sun, 2 Nov 2025 17:05:12 -0500 Subject: HttpServer should implement AutoCloseable? In-Reply-To: References: <2f77eeca-a9f8-4cf9-9569-0f4076b79d4f@oracle.com> Message-ID: Hello, Sending a follow up email since I haven't heard back. If this idea is not wanted, please do lmk. It just felt like a good enough semantic fit that it was worth doing. On Fri, Oct 24, 2025 at 10:56?AM David Alayachew wrote: > Hello @net-dev at openjdk.org , > > Would it be ok if we made HttpServer from the jdk.httpserver module > implement AutoCloseable? Having this would prevent people from forgetting > to close the server after use. Also, there appears to be prior precedent > with HttpExchange. > > The close() implementation could call stop(int delay) with a reasonable > default. This implementation should be a default one, so that existing > child classes that also implemented AutoCloseable lose no functionality. > > Thank you for your time and consideration. > David Alayachew > > > On Fri, Oct 24, 2025 at 10:51?AM David Alayachew > wrote: > >> Thanks Alan, I'll reattempt this thread over there. >> >> On Fri, Oct 24, 2025 at 1:57?AM Alan Bateman >> wrote: >> >>> On 23/10/2025 23:09, David Alayachew wrote: >>> >>> Hello @core-libs-dev , >>> >>> Would it be ok if we made HttpServer from the jdk.httpserver module >>> implement AutoCloseable? Having this would prevent people from forgetting >>> to close the server after use. >>> >>> The close() implementation could call stop(int delay) with a reasonable >>> default. This implementation should be a default one, so that existing >>> child classes that also implemented AutoCloseable lose no functionality. >>> >>> The net-dev mailing list is where networking and HTTP issues are usually >>> discussed. HttpExchange was retrofitted to implement AutoCloseable in JDK >>> 14 and there may have been discussed (can't remember) about HttpServer at >>> the time. >>> >>> -Alan >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From duke at openjdk.org Mon Nov 3 11:54:06 2025 From: duke at openjdk.org (Peyang) Date: Mon, 3 Nov 2025 11:54:06 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v8] In-Reply-To: References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: On Sun, 2 Nov 2025 17:04:22 GMT, Florent Guillaume wrote: >> Peyang has updated the pull request incrementally with one additional commit since the last revision: >> >> Allow unlimited splits when parsing HTTP Range header to detect trailing commas > > test/jdk/com/sun/net/httpserver/simpleserver/FileServerHandlerTest.java line 147: > >> 145: >> 146: // malformed numbers or format >> 147: {"bytes=-0"}, {"bytes=meow"}, {"bytes=--500"}, {"bytes=500"}, {"bytes=-"}, {"bytes=+500-600"}, > > Please add a test for `bytes=400--500` which uses a code path not covered by existing tests. > Also worth adding `bytes=500-+600` and variations with `+` in all possible positions, and omitting left part. > Add also `bytes=--`, `bytes=-+1`, ... I'm sure one could come up with more. Thanks for your review. I've added some of the suggested invalid range patterns to the test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2486212083 From dfuchs at openjdk.org Mon Nov 3 12:08:26 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 12:08:26 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder In-Reply-To: References: Message-ID: On Sun, 2 Nov 2025 07:19:12 GMT, EunHyunsu wrote: > This change adds clearer NullPointerException messages to the POST(), PUT(), and method() methods in HttpRequest.Builder when the provided BodyPublisher is null. > > Each of these methods now calls `requireNonNull(body, "BodyPublisher must not be null")`, making the exception message explicit. > A corresponding regression test (RequestBuilderNullBodyTest) has been added to verify this behavior. > > All builds and related tests (jdk/java/net/httpclient) have passed successfully. > > Currently, only POST(), PUT(), and method() include these messages. > Some other builder methods (such as header(), setHeader()) also throw NullPointerException without a message. > I would like to discuss whether adding consistent messages to those methods would be beneficial, > and whether the current wording "BodyPublisher must not be null" feels appropriate. src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java line 226: > 224: @Override > 225: public HttpRequest.Builder method(String method, BodyPublisher body) { > 226: requireNonNull(method); It seems strange to improve the message for `body` but not for `method`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28103#discussion_r2486250224 From alanb at openjdk.org Mon Nov 3 12:21:05 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 3 Nov 2025 12:21:05 GMT Subject: RFR: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 11:06:35 GMT, serhiysachkov wrote: > [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException test/jdk/com/sun/net/httpserver/Test9.java line 126: > 124: executor.shutdown (); > 125: Files.delete(smallFilePath); > 126: Files.delete(largeFilePath); Wouldn't it be better to have the test wait until the HttpsServer have stopped and the executor has terminated? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28108#discussion_r2486286222 From vyazici at openjdk.org Mon Nov 3 12:24:50 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 12:24:50 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v7] In-Reply-To: References: Message-ID: > Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. > > ### Review guidelines > > 1. Read _"the fix"_ in `MultiExchange` > 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` > 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Simplify Javadoc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27469/files - new: https://git.openjdk.org/jdk/pull/27469/files/1601a185..cd74d1dc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27469&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27469&range=05-06 Stats: 15 lines in 3 files changed: 0 ins; 3 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/27469.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27469/head:pull/27469 PR: https://git.openjdk.org/jdk/pull/27469 From vyazici at openjdk.org Mon Nov 3 12:24:53 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 12:24:53 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v5] In-Reply-To: References: Message-ID: On Thu, 30 Oct 2025 16:17:21 GMT, Michael McMahon wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Replace wrapper's `preTerminationCallback` argument with a method to be extended > > src/java.net.http/share/classes/java/net/http/HttpClient.java line 315: > >> 313: * implementation applies it to the entire connection phase, from the >> 314: * moment a connection is requested until it is established. The >> 315: * elapsed time includes any SSL/TLS handshake. > > Suggestion: > > * A connection timeout applies to the entire connection phase, from the > * moment a connection is requested until it is established. The > * elapsed time includes any SSL/TLS handshake. > > This is a suggested simplification. If acceptable it could be applied to the same doc pattern elsewhere. Improved as suggested in cd74d1dca84. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486291437 From duke at openjdk.org Mon Nov 3 12:27:15 2025 From: duke at openjdk.org (EunHyunsu) Date: Mon, 3 Nov 2025 12:27:15 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v2] In-Reply-To: References: Message-ID: > This change adds clearer NullPointerException messages to the POST(), PUT(), and method() methods in HttpRequest.Builder when the provided BodyPublisher is null. > > Each of these methods now calls `requireNonNull(body, "BodyPublisher must not be null")`, making the exception message explicit. > A corresponding regression test (RequestBuilderNullBodyTest) has been added to verify this behavior. > > All builds and related tests (jdk/java/net/httpclient) have passed successfully. > > Currently, only POST(), PUT(), and method() include these messages. > Some other builder methods (such as header(), setHeader()) also throw NullPointerException without a message. > I would like to discuss whether adding consistent messages to those methods would be beneficial, > and whether the current wording "BodyPublisher must not be null" feels appropriate. EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: 8271091: Add NPE messages for method ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28103/files - new: https://git.openjdk.org/jdk/pull/28103/files/169294d3..24ecfc3b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28103.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28103/head:pull/28103 PR: https://git.openjdk.org/jdk/pull/28103 From duke at openjdk.org Mon Nov 3 12:27:17 2025 From: duke at openjdk.org (EunHyunsu) Date: Mon, 3 Nov 2025 12:27:17 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v2] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:05:31 GMT, Daniel Fuchs wrote: >> EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: >> >> 8271091: Add NPE messages for method > > src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java line 226: > >> 224: @Override >> 225: public HttpRequest.Builder method(String method, BodyPublisher body) { >> 226: requireNonNull(method); > > It seems strange to improve the message for `body` but not for `method`. I agree for consistency. I'll update the `requireNonNull(method)` call to include an explicit message as well, e.g., `requireNonNull(method, "HTTP method must be non-null")`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28103#discussion_r2486295432 From jpai at openjdk.org Mon Nov 3 12:33:56 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 3 Nov 2025 12:33:56 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v2] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:27:15 GMT, EunHyunsu wrote: >> This change adds clearer NullPointerException messages to the POST(), PUT(), and method() methods in HttpRequest.Builder when the provided BodyPublisher is null. >> >> Each of these methods now calls `requireNonNull(body, "BodyPublisher must not be null")`, making the exception message explicit. >> A corresponding regression test (RequestBuilderNullBodyTest) has been added to verify this behavior. >> >> All builds and related tests (jdk/java/net/httpclient) have passed successfully. >> >> Currently, only POST(), PUT(), and method() include these messages. >> Some other builder methods (such as header(), setHeader()) also throw NullPointerException without a message. >> I would like to discuss whether adding consistent messages to those methods would be beneficial, >> and whether the current wording "BodyPublisher must not be null" feels appropriate. > > EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: > > 8271091: Add NPE messages for method Hello @ehs208, instead of a new test class, could you see if the existing tests in `test/jdk/java/net/httpclient/HttpRequestBuilderTest.java` can be updated for additionally checking the `NullPointerException` message wherever applicable? ------------- PR Comment: https://git.openjdk.org/jdk/pull/28103#issuecomment-3480294991 From duke at openjdk.org Mon Nov 3 12:42:40 2025 From: duke at openjdk.org (EunHyunsu) Date: Mon, 3 Nov 2025 12:42:40 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v2] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:31:45 GMT, Jaikiran Pai wrote: > Hello @ehs208, instead of a new test class, could you see if the existing tests in `test/jdk/java/net/httpclient/HttpRequestBuilderTest.java` can be updated for additionally checking the `NullPointerException` message wherever applicable? Thanks for the suggestion! That makes sense ? instead of keeping a separate test class, I can move these checks into `HttpRequestBuilderTest.java`. However, since the existing `testNull()` method focuses only on verifying that NPEs are thrown (regardless of message content), would it make sense to add a small new test method, say `testNullMessages()`, in the same class to verify the exception messages specifically? That way we keep the tests co-located but with a clear separation of intent. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28103#issuecomment-3480333147 From dfuchs at openjdk.org Mon Nov 3 12:51:19 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 12:51:19 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v7] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:24:50 GMT, Volkan Yazici wrote: >> Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. >> >> ### Review guidelines >> >> 1. Read _"the fix"_ in `MultiExchange` >> 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` >> 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Simplify Javadoc src/java.net.http/share/classes/java/net/http/HttpClient.java line 321: > 319: * @throws IllegalArgumentException if the duration is non-positive > 320: * @see HttpRequest.Builder#timeout(Duration) Configuring timeout for > 321: * request execution Did you verify what javadoc generated for that? src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java line 256: > 254: } > 255: > 256: public void cancelTimer() { We could leave that package private. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486358857 PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486374196 From dfuchs at openjdk.org Mon Nov 3 13:03:28 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 13:03:28 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v7] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:24:50 GMT, Volkan Yazici wrote: >> Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. >> >> ### Review guidelines >> >> 1. Read _"the fix"_ in `MultiExchange` >> 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` >> 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Simplify Javadoc src/java.net.http/share/classes/java/net/http/HttpRequest.java line 282: > 280: * @throws IllegalArgumentException if the duration is non-positive > 281: * @see HttpClient.Builder#connectTimeout(Duration) Configuring > 282: * timeout for connection establishment Same here - please verify how this looks in generated API doc test/jdk/java/net/httpclient/TimeoutResponseTestSupport.java line 187: > 185: } > 186: > 187: private static HttpServerAdapters.HttpTestServer createServer( Can we use imports to reduce the long class names please ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486383526 PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486403677 From vyazici at openjdk.org Mon Nov 3 14:10:47 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 14:10:47 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v5] In-Reply-To: References: Message-ID: > Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. 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: - Merge remote-tracking branch 'upstream/master' into bigDuration - Merge remote-tracking branch 'upstream/master' into bigDuration - Simplify exception handling in `Deadline::between` Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com> - Move `delta == 0` in `until()` to the catch block - Add `DeadlineOverflowTest` - Fix duration overflows - Add `DurationOverflowTest` ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27973/files - new: https://git.openjdk.org/jdk/pull/27973/files/970754a7..351de8c2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=03-04 Stats: 300 lines in 9 files changed: 282 ins; 5 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/27973.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27973/head:pull/27973 PR: https://git.openjdk.org/jdk/pull/27973 From duke at openjdk.org Mon Nov 3 14:23:48 2025 From: duke at openjdk.org (serhiysachkov) Date: Mon, 3 Nov 2025 14:23:48 GMT Subject: RFR: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:18:17 GMT, Alan Bateman wrote: >> [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException > > test/jdk/com/sun/net/httpserver/Test9.java line 126: > >> 124: executor.shutdown (); >> 125: Files.delete(smallFilePath); >> 126: Files.delete(largeFilePath); > > Wouldn't it be better to have the test wait until the HttpsServer have stopped and the executor has terminated? The test used 2 approaches here: deleteOnExit() and explicit delete, so my idea here to align behaviour to use single approach that will delete files, plus the stop method timeout was updated from 2 to 0 couple commits ago, so wasn't sure if it's good idea to pop it up again. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28108#discussion_r2486653511 From dfuchs at openjdk.org Mon Nov 3 14:34:02 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 14:34:02 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v5] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 14:10:47 GMT, Volkan Yazici wrote: >> Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. > > 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: > > - Merge remote-tracking branch 'upstream/master' into bigDuration > - Merge remote-tracking branch 'upstream/master' into bigDuration > - Simplify exception handling in `Deadline::between` > > Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com> > - Move `delta == 0` in `until()` to the catch block > - Add `DeadlineOverflowTest` > - Fix duration overflows > - Add `DurationOverflowTest` src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 43: > 41: * numeric overflow, {@link #plus(Duration) plus()} will return > 42: * {@link Deadline#MAX} if the provided duration is positive, > 43: * {@link Deadline#MIN} otherwise. Instead of speaking of overflow I wonder if we should say: Operations that add durations to a {@code Deadline}, whether represented as a `Duration` or as a `long` time increment (such as seconds or nano seconds) do not throw if the resulting {@code Deadline} would exceed {@link #MAX} or be less than {@link #MIN}. Instead, {@code MAX} or {@code MIN} are returned, respectively. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486686631 From vyazici at openjdk.org Mon Nov 3 14:36:26 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 14:36:26 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v8] In-Reply-To: References: Message-ID: > Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. > > ### Review guidelines > > 1. Read _"the fix"_ in `MultiExchange` > 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` > 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 31 commits: - Shorten `TimeoutResponseTestSupport` using imports - Make `MultiExchange::cancelTimer` package-private - Merge remote-tracking branch 'upstream/master' into respBodyTime - Simplify Javadoc - Merge remote-tracking branch 'upstream/master' into respBodyTime - Improve `HttpBodySubscriberWrapper::onTermination` JavaDoc - Mark `SubscriptionWrapper` as `final` - Replace wrapper's `preTerminationCallback` argument with a method to be extended - Fix `HttpClient` doc typo - Invoke `preTerminationCallback` at `cancel()` too - ... and 21 more: https://git.openjdk.org/jdk/compare/ef464d69...55396846 ------------- Changes: https://git.openjdk.org/jdk/pull/27469/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27469&range=07 Stats: 840 lines in 12 files changed: 829 ins; 5 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27469.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27469/head:pull/27469 PR: https://git.openjdk.org/jdk/pull/27469 From vyazici at openjdk.org Mon Nov 3 14:36:30 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 14:36:30 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v7] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:46:37 GMT, Daniel Fuchs wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Simplify Javadoc > > src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java line 256: > >> 254: } >> 255: >> 256: public void cancelTimer() { > > We could leave that package private. Implemented in 6d467a8f3cf. > test/jdk/java/net/httpclient/TimeoutResponseTestSupport.java line 187: > >> 185: } >> 186: >> 187: private static HttpServerAdapters.HttpTestServer createServer( > > Can we use imports to reduce the long class names please Implemented in 55396846d1a. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486695255 PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486694312 From vyazici at openjdk.org Mon Nov 3 14:42:25 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 14:42:25 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v7] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 12:40:45 GMT, Daniel Fuchs wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Simplify Javadoc > > src/java.net.http/share/classes/java/net/http/HttpClient.java line 321: > >> 319: * @throws IllegalArgumentException if the duration is non-positive >> 320: * @see HttpRequest.Builder#timeout(Duration) Configuring timeout for >> 321: * request execution > > Did you verify what javadoc generated for that? image > src/java.net.http/share/classes/java/net/http/HttpRequest.java line 282: > >> 280: * @throws IllegalArgumentException if the duration is non-positive >> 281: * @see HttpClient.Builder#connectTimeout(Duration) Configuring >> 282: * timeout for connection establishment > > Same here - please verify how this looks in generated API doc image ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486707602 PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486712247 From vyazici at openjdk.org Mon Nov 3 14:42:29 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 14:42:29 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v8] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 14:36:26 GMT, Volkan Yazici wrote: >> Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. >> >> ### Review guidelines >> >> 1. Read _"the fix"_ in `MultiExchange` >> 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` >> 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) > > Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 31 commits: > > - Shorten `TimeoutResponseTestSupport` using imports > - Make `MultiExchange::cancelTimer` package-private > - Merge remote-tracking branch 'upstream/master' into respBodyTime > - Simplify Javadoc > - Merge remote-tracking branch 'upstream/master' into respBodyTime > - Improve `HttpBodySubscriberWrapper::onTermination` JavaDoc > - Mark `SubscriptionWrapper` as `final` > - Replace wrapper's `preTerminationCallback` argument with a method to be extended > - Fix `HttpClient` doc typo > - Invoke `preTerminationCallback` at `cancel()` too > - ... and 21 more: https://git.openjdk.org/jdk/compare/ef464d69...55396846 src/java.net.http/share/classes/java/net/http/WebSocket.java line 151: > 149: * moment a connection is requested until it is established. The elapsed > 150: * time includes any SSL/TLS handshake. > 151: * Generated output LGTM: image ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486716503 From dfuchs at openjdk.org Mon Nov 3 14:53:46 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 14:53:46 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v5] In-Reply-To: References: Message-ID: <3j-J4T7hnbLu0Fl7xS4ooEvSKDbCTAJPgUxPUedWSxs=.524c9ba0-2880-48d4-9a87-7487887445cb@github.com> On Mon, 3 Nov 2025 14:10:47 GMT, Volkan Yazici wrote: >> Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. > > 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: > > - Merge remote-tracking branch 'upstream/master' into bigDuration > - Merge remote-tracking branch 'upstream/master' into bigDuration > - Simplify exception handling in `Deadline::between` > > Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com> > - Move `delta == 0` in `until()` to the catch block > - Add `DeadlineOverflowTest` > - Fix duration overflows > - Add `DurationOverflowTest` src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 43: > 41: * numeric overflow, {@link #plus(Duration) plus()} will return > 42: * {@link Deadline#MAX} if the provided duration is positive, > 43: * {@link Deadline#MIN} otherwise. Suggestion: *

Operations that add durations to a {@code Deadline}, whether * represented as a `Duration` or as a `long` time increment (such as seconds or nano * seconds) do not throw on numeric overflow if the resulting {@code Deadline} would * exceed {@link #MAX} or be less than {@link #MIN}. Instead, {@code MAX} or {@code MIN} * are returned, respectively. src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 61: > 59: * This instance is immutable and unaffected by this method call. > 60: *

> 61: * On numeric overflows, this method will return {@link Deadline#MAX} if Suggestion: * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 107: > 105: * This instance is immutable and unaffected by this method call. > 106: *

> 107: * On numeric overflows, this method will return {@link Deadline#MIN} if Suggestion: * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MIN} if src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 131: > 129: * This instance is immutable and unaffected by this method call. > 130: *

> 131: * On numeric overflows, this method will return {@link Deadline#MAX} if Suggestion: * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 155: > 153: * This instance is immutable and unaffected by this method call. > 154: *

> 155: * On numeric overflows, this method will return {@link Deadline#MAX} if Suggestion: * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 175: > 173: * This instance is immutable and unaffected by this method call. > 174: *

> 175: * On numeric overflows, this method will return {@link Deadline#MAX} if Suggestion: * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 195: > 193: * This instance is immutable and unaffected by this method call. > 194: *

> 195: * On numeric overflows, this method will return {@link Deadline#MAX} if Suggestion: * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486703151 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486706972 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486717294 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486719109 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486722302 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486724207 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2486726049 From dfuchs at openjdk.org Mon Nov 3 15:39:13 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 15:39:13 GMT Subject: RFR: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 11:06:35 GMT, serhiysachkov wrote: > [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException Marked as reviewed by dfuchs (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28108#pullrequestreview-3411616876 From dfuchs at openjdk.org Mon Nov 3 15:39:16 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 15:39:16 GMT Subject: RFR: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 14:20:29 GMT, serhiysachkov wrote: >> test/jdk/com/sun/net/httpserver/Test9.java line 126: >> >>> 124: executor.shutdown (); >>> 125: Files.delete(smallFilePath); >>> 126: Files.delete(largeFilePath); >> >> Wouldn't it be better to have the test wait until the HttpsServer have stopped and the executor has terminated? > > The test used 2 approaches here: deleteOnExit() and explicit delete, so my idea here to align behaviour to use single approach that will delete files, plus the stop method timeout was updated from 2 to 0 couple commits ago, so wasn't sure if it's good idea to pop it up again. We could simply let `jtreg` do the deletion. We run these tests in `/othervm` so `deleteOnExit()` is a possibility. Alternative would be to call `stop(Integer.MAX_VALUE)` and `executor.close()` - but then we'd need to be sure the the fixes to `HttpServer::stop` have been backported wherever this fix will be backported. If `deleteOnExit()` solves the issue I'm OK with it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28108#discussion_r2486924508 From dfuchs at openjdk.org Mon Nov 3 16:01:44 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 16:01:44 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v6] In-Reply-To: References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: <0v49K19iLf33_xI6mfN5l3BziRkCPUqeIoiyCp8lRa0=.2230a7d3-7ebc-44e6-9e08-d2d5422bdfc7@github.com> On Sat, 1 Nov 2025 10:24:45 GMT, Peyang wrote: >> Yes please. I'd prefer to have built-in validation. > > I implemented a check that validates whether the ranges are in ascendnig order and non-overlapping, returning an error if they are not. > However, I have some concerns: this restriction might be too strict. > > Instead of outright rejecting requests with overlapping or unsorted ranges, what if the server simply combines overlapping ranges and sorts them before returning? > According to [RFC 7233 ?15.3.7.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.7.2-4): >> When multiple ranges are requested, a server **MAY** coalesce any of the ranges that overlap, or that are separated by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the corresponding range-spec appeared in the received [Range](https://www.rfc-editor.org/rfc/rfc9110.html#field.range) header field. > > In other words, rather than strictly validating and rejecting, we could treat this as an efficiency optimization on the server side. I think this approach would be more practical. I?d like to hear your thoughts on this. That would be fine too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2487001106 From daniel.fuchs at oracle.com Mon Nov 3 16:03:36 2025 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 3 Nov 2025 16:03:36 +0000 Subject: HttpServer should implement AutoCloseable? In-Reply-To: References: <2f77eeca-a9f8-4cf9-9569-0f4076b79d4f@oracle.com> Message-ID: <4a545e96-839c-4137-855b-f9af0fe59da0@oracle.com> Hi David, That sounds like something worthwhile. best regards, -- daniel On 02/11/2025 22:05, David Alayachew wrote: > Hello, > > Sending a follow up email since I haven't heard back. If this idea is > not wanted, please do lmk. It just felt like a good enough semantic fit > that it was worth doing. > From dfuchs at openjdk.org Mon Nov 3 16:11:28 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 16:11:28 GMT Subject: RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v2] In-Reply-To: References: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> Message-ID: On Sat, 1 Nov 2025 15:50:33 GMT, EunHyunsu wrote: >Upon checking again, I noticed that the asynchronous example is indented slightly more than the synchronous one. > It appears that this difference already existed prior to my patch. > Just wanted to confirm whether this is intentional or if we should align the indentation for consistency. It looks like it's only the first line in the asynchronous example that is misaligned. It would be good to fix it along in this PR. Thanks for catching this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28084#issuecomment-3481310861 From jpai at openjdk.org Mon Nov 3 16:15:50 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Mon, 3 Nov 2025 16:15:50 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v2] In-Reply-To: References: Message-ID: <5B3wKzsQnst9zPxsqwsVI21oYyZ3hU4wQhZ_QtteFSc=.9e0edcdb-db86-423a-ad8a-45f7be03c178@github.com> On Mon, 3 Nov 2025 12:40:27 GMT, EunHyunsu wrote: > would it make sense to add a small new test method, say testNullMessages(), in the same class to verify the exception messages specifically? I think that should be OK. It doesn't have to be too complicated/generic either, as long as it tests these specific method calls. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28103#issuecomment-3481344136 From dfuchs at openjdk.org Mon Nov 3 16:19:45 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 3 Nov 2025 16:19:45 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread Message-ID: This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. ------------- Commit messages: - Add a new test - Merge branch 'master' into quic-vt-8369920 - Merge branch 'master' into quic-vt-8369920 - Draft - 8369920: HttpClient QuicSelectorThread could be a VirtualThread Changes: https://git.openjdk.org/jdk/pull/27827/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369920 Stats: 288 lines in 3 files changed: 277 ins; 0 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/27827.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27827/head:pull/27827 PR: https://git.openjdk.org/jdk/pull/27827 From duke at openjdk.org Mon Nov 3 17:29:46 2025 From: duke at openjdk.org (duke) Date: Mon, 3 Nov 2025 17:29:46 GMT Subject: RFR: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 11:06:35 GMT, serhiysachkov wrote: > [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException @serhiysachkov Your change (at version f05fe8e4f3cf2caa3a9d23cd6d0f952de2ae52b4) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28108#issuecomment-3481695404 From davidalayachew at gmail.com Mon Nov 3 17:31:22 2025 From: davidalayachew at gmail.com (David Alayachew) Date: Mon, 3 Nov 2025 12:31:22 -0500 Subject: HttpServer should implement AutoCloseable? In-Reply-To: <4a545e96-839c-4137-855b-f9af0fe59da0@oracle.com> References: <2f77eeca-a9f8-4cf9-9569-0f4076b79d4f@oracle.com> <4a545e96-839c-4137-855b-f9af0fe59da0@oracle.com> Message-ID: ? David reacted via Gmail On Mon, Nov 3, 2025, 11:03?AM Daniel Fuchs wrote: > Hi David, > > That sounds like something worthwhile. > > best regards, > > -- daniel > > On 02/11/2025 22:05, David Alayachew wrote: > > Hello, > > > > Sending a follow up email since I haven't heard back. If this idea is > > not wanted, please do lmk. It just felt like a good enough semantic fit > > that it was worth doing. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/vnd.google.email-reaction+json Size: 37 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From duke at openjdk.org Mon Nov 3 20:18:32 2025 From: duke at openjdk.org (Josiah Noel) Date: Mon, 3 Nov 2025 20:18:32 GMT Subject: RFR: 8349670: HttpServer: sending interim responses fails after JDK-7026262 [v21] In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 18:12:52 GMT, Josiah Noel wrote: >> Following the guideline of the last comment on [JDK-8349670](https://bugs.openjdk.org/browse/JDK-8349670?focusedId=14794649&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14794649), resolves the issue where sending a 1xx status code would close the input stream, preventing the server from reading the body. >> >> - When a 1xx status code is sent by `sendResponseHeaders`, the input/output streams will not be closed prematurely. >> - sentHeaders will not be set to true when sending 1xx status codes >> - 100-continue will be sent automatically when trying to read the inputstream if `Expect: 100-continue` header is present > > Josiah Noel has updated the pull request incrementally with one additional commit since the last revision: > > Update Send1xxResponsesTest.java closing as there are better ways to handle 100-continue ------------- PR Comment: https://git.openjdk.org/jdk/pull/27069#issuecomment-3482410665 From duke at openjdk.org Mon Nov 3 20:18:34 2025 From: duke at openjdk.org (Josiah Noel) Date: Mon, 3 Nov 2025 20:18:34 GMT Subject: Withdrawn: 8349670: HttpServer: sending interim responses fails after JDK-7026262 In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 12:06:45 GMT, Josiah Noel wrote: > Following the guideline of the last comment on [JDK-8349670](https://bugs.openjdk.org/browse/JDK-8349670?focusedId=14794649&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14794649), resolves the issue where sending a 1xx status code would close the input stream, preventing the server from reading the body. > > - When a 1xx status code is sent by `sendResponseHeaders`, the input/output streams will not be closed prematurely. > - sentHeaders will not be set to true when sending 1xx status codes > - 100-continue will be sent automatically when trying to read the inputstream if `Expect: 100-continue` header is present This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/27069 From vyazici at openjdk.org Mon Nov 3 21:19:55 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Mon, 3 Nov 2025 21:19:55 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 15:58:23 GMT, Daniel Fuchs wrote: > This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. > > The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicEndpoint.java line 148: > 146: MAX_BUFFERED_LOW = maxBufferLow; > 147: String useVtForSelector = > 148: System.getProperty("jdk.internal.httpclient.quic.useVTForSelector", "default"); We already have a `jdk.internal.httpclient.quic.poller.usePlatformThreads`. To follow the same naming convention, you might consider renaming this to `j.i.h.q.selector.useVirtualThreads`. src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicSelector.java line 510: > 508: } > 509: > 510: private record QuicSelectorThread(Thread thread) { AFAICS, all methods ? `start()`, `join()`, `ofPlatform()`, `ofVirtual()`, and `of()` ? can be `private`. test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 2: > 1: /* > 2: * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. Suggestion: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 54: > 52: * @bug 8369920 > 53: * @summary Basic test to verify that the QuicSelector > 54: * uses a VirtualThread Suggestion: * @summary Verifies whether `QuicSelector` uses virtual threads when no explicit configuration is provided test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 57: > 55: * @library /test/lib /test/jdk/java/net/httpclient/lib > 56: * @build jdk.test.lib.net.SimpleSSLContext > 57: * jdk.httpclient.test.lib.common.HttpServerAdapters @sormuras, in this JUnit test, given these `@build` classes are already included in `@library`, do we still need this explicit `@build`? test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 66: > 64: * @bug 8369920 > 65: * @summary Basic test to verify that the QuicSelector > 66: * uses a VirtualThread This summary contradicts with this particular `@test`. That is, this `@test` verifies `QuicSelector` does *not* use a virtual thread. While I agree that `@test id=...` hints about the semantics, having an accurate `@summary` would not hurt: Suggestion: * @summary Verifies that `QuicSelector` does *not* use virtual threads when explicitly configured so test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 79: > 77: * @bug 8369920 > 78: * @summary Basic test to verify that the QuicSelector > 79: * uses a VirtualThread Suggestion: * @summary Verifies that `QuicSelector` does *always* use virtual threads when explicitly configured so test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 92: > 90: * @bug 8369920 > 91: * @summary Basic test to verify that the QuicSelector > 92: * uses a VirtualThread Suggestion: * @summary Verifies whether `QuicSelector` uses virtual threads when `default` is explicitly configured test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 105: > 103: * @bug 8369920 > 104: * @summary Basic test to verify that the QuicSelector > 105: * uses a VirtualThread Suggestion: * @summary Verifies whether `QuicSelector` uses virtual threads when it is configured using an invalid value test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 115: > 113: */ > 114: // -Djava.security.debug=all > 115: public class H3QuicVTTest implements HttpServerAdapters { Suggestion: class H3QuicVTTest implements HttpServerAdapters { test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 132: > 130: } > 131: > 132: static boolean isQuicSelectorThreadVirtual() { Suggestion: private static boolean isQuicSelectorThreadVirtual() { test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 141: > 139: > 140: @BeforeAll > 141: public static void beforeClass() throws Exception { Suggestion: static void beforeClass() throws Exception { test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 155: > 153: > 154: @AfterAll > 155: public static void afterClass() throws Exception { Suggestion: static void afterClass() throws Exception { test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 166: > 164: */ > 165: @Test > 166: public void testBasicRequests() throws Exception { Suggestion: void testBasicRequests() throws Exception { test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 199: > 197: } > 198: > 199: void assertSelectorThread(HttpClient client) { Suggestion: private static void assertSelectorThread(HttpClient client) { test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 200: > 198: > 199: void assertSelectorThread(HttpClient client) { > 200: Objects.requireNonNull(client); I doubt if this is needed. Suggestion: test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 206: > 204: .map(Thread::getName) > 205: .toList()); > 206: boolean found = threads.contains(name); Using thread name for this check looks very fragile. Can we devise a more programmatic method? E.g., ensuring no `StackTraceElement` contains `QuicSelectorThread`? test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 224: > 222: System.out.printf("%s: %s%n", status, msg); > 223: } > 224: Assertions.assertEquals(!isQuicSelectorThreadVirtual(), threads.contains(name), msg); Suggestion: Assertions.assertEquals(!isQuicSelectorThreadVirtual(), found, msg); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487864987 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487758171 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487761972 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487818322 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487846396 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487823188 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487831510 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487834314 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487835902 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487846842 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487848843 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487847519 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487847819 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487847208 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487849223 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487850445 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487801799 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2487764764 From duke at openjdk.org Tue Nov 4 02:04:14 2025 From: duke at openjdk.org (serhiysachkov) Date: Tue, 4 Nov 2025 02:04:14 GMT Subject: Integrated: 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 11:06:35 GMT, serhiysachkov wrote: > [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException This pull request has now been integrated. Changeset: 576f9694 Author: Serhiy Sachkov Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/576f9694b092f2a11a6a4e5a82c2b0e12203bd9c Stats: 10 lines in 1 file changed: 2 ins; 5 del; 3 mod 8361106: [TEST] com/sun/net/httpserver/Test9.java fails with java.nio.file.FileSystemException Reviewed-by: dfuchs ------------- PR: https://git.openjdk.org/jdk/pull/28108 From vyazici at openjdk.org Tue Nov 4 08:06:47 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 08:06:47 GMT Subject: Integrated: 8366575: Remove SDP support In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 08:40:35 GMT, Volkan Yazici wrote: > Remove support for [SDP] (Sockets Direct Protocol), which has been obsolete for more than a decade ? see [JDK-8366575] for details. Tier1-2 is clear. > > [SDP]: https://docs.oracle.com/javase/tutorial/sdp/sockets/overview.html > [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 This pull request has now been integrated. Changeset: c1476fca Author: Volkan Yazici URL: https://git.openjdk.org/jdk/commit/c1476fca9d7a679d32b7b43956638b845d1027cc Stats: 732 lines in 13 files changed: 0 ins; 732 del; 0 mod 8366575: Remove SDP support Reviewed-by: alanb, erikj, jpai, michaelm ------------- PR: https://git.openjdk.org/jdk/pull/28012 From vyazici at openjdk.org Tue Nov 4 11:00:30 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 11:00:30 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences Message-ID: `java.net.Socket::setPerformancePreferences` was introduced in Java 1.5 with the intention of providing a declarative API for configuring the performance-wise characteristics of the underlying socket. It has always been a no-op and a corpus search does not reveal any significant usages of it. Recently merged [JDK-8366575] removes the SDP (Sockets Direct Protocol) support, and this further undermines the value of `setPerformancePreferences`. This PR deprecates `setPerformancePreferences` and friends _for removal_. [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 ------------- Commit messages: - Deprecate `Socket::setPerformancePreferences` and friends for removal Changes: https://git.openjdk.org/jdk/pull/28129/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28129&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366577 Stats: 5 lines in 4 files changed: 4 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28129.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28129/head:pull/28129 PR: https://git.openjdk.org/jdk/pull/28129 From vyazici at openjdk.org Tue Nov 4 11:04:38 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 11:04:38 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v6] In-Reply-To: References: Message-ID: > Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Use `

` in Javadoc as suggested in reviews ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27973/files - new: https://git.openjdk.org/jdk/pull/27973/files/351de8c2..2634e743 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=04-05 Stats: 27 lines in 1 file changed: 6 ins; 0 del; 21 mod Patch: https://git.openjdk.org/jdk/pull/27973.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27973/head:pull/27973 PR: https://git.openjdk.org/jdk/pull/27973 From vyazici at openjdk.org Tue Nov 4 11:04:53 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 11:04:53 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v5] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 14:30:28 GMT, Daniel Fuchs 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: >> >> - Merge remote-tracking branch 'upstream/master' into bigDuration >> - Merge remote-tracking branch 'upstream/master' into bigDuration >> - Simplify exception handling in `Deadline::between` >> >> Co-authored-by: Daniel Fuchs <67001856+dfuch at users.noreply.github.com> >> - Move `delta == 0` in `until()` to the catch block >> - Add `DeadlineOverflowTest` >> - Fix duration overflows >> - Add `DurationOverflowTest` > > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 43: > >> 41: * numeric overflow, {@link #plus(Duration) plus()} will return >> 42: * {@link Deadline#MAX} if the provided duration is positive, >> 43: * {@link Deadline#MIN} otherwise. > > Instead of speaking of overflow I wonder if we should say: > > > Operations that add durations to a {@code Deadline}, whether represented as > a `Duration` or as a `long` time increment (such as seconds or nano seconds) do > not throw if the resulting {@code Deadline} would exceed {@link #MAX} or be less > than {@link #MIN}. Instead, {@code MAX} or {@code MIN} are returned, respectively. Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 43: > >> 41: * numeric overflow, {@link #plus(Duration) plus()} will return >> 42: * {@link Deadline#MAX} if the provided duration is positive, >> 43: * {@link Deadline#MIN} otherwise. > > Suggestion: > > *

Operations that add durations to a {@code Deadline}, whether > * represented as a `Duration` or as a `long` time increment (such as seconds or nano > * seconds) do not throw on numeric overflow if the resulting {@code Deadline} would > * exceed {@link #MAX} or be less than {@link #MIN}. Instead, {@code MAX} or {@code MIN} > * are returned, respectively. Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 61: > >> 59: * This instance is immutable and unaffected by this method call. >> 60: *

>> 61: * On numeric overflows, this method will return {@link Deadline#MAX} if > > Suggestion: > > * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 107: > >> 105: * This instance is immutable and unaffected by this method call. >> 106: *

>> 107: * On numeric overflows, this method will return {@link Deadline#MIN} if > > Suggestion: > > * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MIN} if Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 131: > >> 129: * This instance is immutable and unaffected by this method call. >> 130: *

>> 131: * On numeric overflows, this method will return {@link Deadline#MAX} if > > Suggestion: > > * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 155: > >> 153: * This instance is immutable and unaffected by this method call. >> 154: *

>> 155: * On numeric overflows, this method will return {@link Deadline#MAX} if > > Suggestion: > > * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 175: > >> 173: * This instance is immutable and unaffected by this method call. >> 174: *

>> 175: * On numeric overflows, this method will return {@link Deadline#MAX} if > > Suggestion: > > * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if Applied in 2634e743025. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 195: > >> 193: * This instance is immutable and unaffected by this method call. >> 194: *

>> 195: * On numeric overflows, this method will return {@link Deadline#MAX} if > > Suggestion: > > * On {@linkplain ##overflow numeric overflows}, this method will return {@link Deadline#MAX} if Applied in 2634e743025. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489992634 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489993179 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489996983 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489994097 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489994864 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489996607 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489995191 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2489995724 From duke at openjdk.org Tue Nov 4 11:11:26 2025 From: duke at openjdk.org (EunHyunsu) Date: Tue, 4 Nov 2025 11:11:26 GMT Subject: RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v3] In-Reply-To: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> References: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> Message-ID: > Fixes JDK-8371009. > > The synchronous HttpClient example references `request` without defining it. > This patch adds a minimal HttpRequest initialization immediately before the > synchronous example (mirroring the asynchronous snippet) so the example > compiles and runs as-is. EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: JDK-8371009: fix indent ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28084/files - new: https://git.openjdk.org/jdk/pull/28084/files/0c799d0e..34f8d04b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28084&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28084&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28084.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28084/head:pull/28084 PR: https://git.openjdk.org/jdk/pull/28084 From duke at openjdk.org Tue Nov 4 11:21:56 2025 From: duke at openjdk.org (EunHyunsu) Date: Tue, 4 Nov 2025 11:21:56 GMT Subject: RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v2] In-Reply-To: References: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> Message-ID: <4aBaKVMNRyafRsxnG2VhVN2dqVcGxByfz7xJbMBm7s4=.1e6cf996-c5f7-425f-86cd-1d5c5fd329bc@github.com> On Mon, 3 Nov 2025 16:08:11 GMT, Daniel Fuchs wrote: > > Upon checking again, I noticed that the asynchronous example is indented slightly more than the synchronous one. > > It appears that this difference already existed prior to my patch. > > Just wanted to confirm whether this is intentional or if we should align the indentation for consistency. > > It looks like it's only the first line in the asynchronous example that is misaligned. It would be good to fix it along in this PR. Thanks for catching this. Thanks! The indentation fix has been included in the latest commit. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28084#issuecomment-3485437784 From duke at openjdk.org Tue Nov 4 11:23:17 2025 From: duke at openjdk.org (EunHyunsu) Date: Tue, 4 Nov 2025 11:23:17 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v3] In-Reply-To: References: Message-ID: > This change adds clearer NullPointerException messages to the POST(), PUT(), and method() methods in HttpRequest.Builder when the provided BodyPublisher is null. > > Each of these methods now calls `requireNonNull(body, "BodyPublisher must not be null")`, making the exception message explicit. > A corresponding regression test (RequestBuilderNullBodyTest) has been added to verify this behavior. > > All builds and related tests (jdk/java/net/httpclient) have passed successfully. > > Currently, only POST(), PUT(), and method() include these messages. > Some other builder methods (such as header(), setHeader()) also throw NullPointerException without a message. > I would like to discuss whether adding consistent messages to those methods would be beneficial, > and whether the current wording "BodyPublisher must not be null" feels appropriate. EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: 8371091: Add testNullMessages() to HttpRequestBuilderTest ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28103/files - new: https://git.openjdk.org/jdk/pull/28103/files/24ecfc3b..b90837b0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=01-02 Stats: 526 lines in 2 files changed: 36 ins; 59 del; 431 mod Patch: https://git.openjdk.org/jdk/pull/28103.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28103/head:pull/28103 PR: https://git.openjdk.org/jdk/pull/28103 From duke at openjdk.org Tue Nov 4 11:33:45 2025 From: duke at openjdk.org (Peyang) Date: Tue, 4 Nov 2025 11:33:45 GMT Subject: RFR: 8371092: NullPointerException in AltServiceUsageTest.afterClass() test In-Reply-To: References: Message-ID: On Sun, 2 Nov 2025 14:09:28 GMT, Peyang wrote: > - Add `safeClose(DatagramChannel)` to close udpNotResponding safely. > - Null-check and exception handling unified with `safeStop()`. > - Ensures test cleanup never fails due to uninitialized or problematic channel. Thanks for your review. I've run the test locally and confirmed it passes successfully. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28104#issuecomment-3485501240 From duke at openjdk.org Tue Nov 4 11:33:46 2025 From: duke at openjdk.org (duke) Date: Tue, 4 Nov 2025 11:33:46 GMT Subject: RFR: 8371092: NullPointerException in AltServiceUsageTest.afterClass() test In-Reply-To: References: Message-ID: On Sun, 2 Nov 2025 14:09:28 GMT, Peyang wrote: > - Add `safeClose(DatagramChannel)` to close udpNotResponding safely. > - Null-check and exception handling unified with `safeStop()`. > - Ensures test cleanup never fails due to uninitialized or problematic channel. @PeyaPeyaPeyang Your change (at version c069042f507e1cccf1f6ad101f73cf28d15dd238) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28104#issuecomment-3485514508 From duke at openjdk.org Tue Nov 4 11:37:13 2025 From: duke at openjdk.org (EunHyunsu) Date: Tue, 4 Nov 2025 11:37:13 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v4] In-Reply-To: References: Message-ID: > This change adds clearer NullPointerException messages to the POST(), PUT(), and method() methods in HttpRequest.Builder when the provided BodyPublisher is null. > > Each of these methods now calls `requireNonNull(body, "BodyPublisher must not be null")`, making the exception message explicit. > A corresponding regression test (RequestBuilderNullBodyTest) has been added to verify this behavior. > > All builds and related tests (jdk/java/net/httpclient) have passed successfully. > > Currently, only POST(), PUT(), and method() include these messages. > Some other builder methods (such as header(), setHeader()) also throw NullPointerException without a message. > I would like to discuss whether adding consistent messages to those methods would be beneficial, > and whether the current wording "BodyPublisher must not be null" feels appropriate. EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: 8371091: Add testNullMessages() to HttpRequestBuilderTest and fix whitespaces error ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28103/files - new: https://git.openjdk.org/jdk/pull/28103/files/b90837b0..f26cc336 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28103&range=02-03 Stats: 468 lines in 1 file changed: 1 ins; 0 del; 467 mod Patch: https://git.openjdk.org/jdk/pull/28103.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28103/head:pull/28103 PR: https://git.openjdk.org/jdk/pull/28103 From duke at openjdk.org Tue Nov 4 11:37:15 2025 From: duke at openjdk.org (EunHyunsu) Date: Tue, 4 Nov 2025 11:37:15 GMT Subject: RFR: 8371091: Improve the exception message of NullPointerException thrown by the methods in the default implementation of HttpRequest.Builder [v2] In-Reply-To: <5B3wKzsQnst9zPxsqwsVI21oYyZ3hU4wQhZ_QtteFSc=.9e0edcdb-db86-423a-ad8a-45f7be03c178@github.com> References: <5B3wKzsQnst9zPxsqwsVI21oYyZ3hU4wQhZ_QtteFSc=.9e0edcdb-db86-423a-ad8a-45f7be03c178@github.com> Message-ID: On Mon, 3 Nov 2025 16:13:17 GMT, Jaikiran Pai wrote: > > would it make sense to add a small new test method, > > say testNullMessages(), in the same class to verify the exception messages specifically? > > I think that should be OK. It doesn't have to be too complicated/generic either, as long as it tests these specific method calls. Thanks for confirming! I?ll add a straightforward testNullMessages() method in the same class to verify those specific calls. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28103#issuecomment-3485522603 From duke at openjdk.org Tue Nov 4 13:34:42 2025 From: duke at openjdk.org (Peyang) Date: Tue, 4 Nov 2025 13:34:42 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v10] In-Reply-To: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: > Hi all, > > [JEP 408](https://openjdk.org/jeps/408) introduced the Simple Web Server in Java 18, providing a minimal webserver for serving static files over HTTP. > > [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-range-requests) defines "Range Requests" as an optional feature that allows clients to request a subset of a resource's content. Supporting Range requests in the context of JDK's Simple Web Server means enabling the server to serve only the requested portion of a static file. > > This change contains: > > 1. Enhances `sun.net.httpserver.simpleserver.FileServerHandler` in the `jdk.httpserver` module to support `Range` and `If-Range` headers. > 2. Calculates an `ETag` for each resource based on its last-modified date and file size and sends it to the client on demand for use with the `If-Range` header. > 3. Returns the `Accept-Ranges` header for all file retrievals, and `Content-Range` when a client requests a specific range. > 4. Adds a new constant `HTTP_RANGE_NOT_SATISFIABLE` to the `Codes` class to indicate invalid ranges. > 5. Returns `206 Partial Content` for valid ranges and `416 Range Not Satisfiable` for invalid ranges. > 6. Includes corresponding tests to verify correct behavior. > > This enhancement was motivated by recent discussions on the net-dev mailing list, which requested support for Range requests along with example use cases: https://mail.openjdk.org/pipermail/net-dev/2025-April/026364.html > It was also discussed briefly on the net-dev mailing list: https://mail.openjdk.org/pipermail/net-dev/2025-October/028586.html Peyang has updated the pull request incrementally with one additional commit since the last revision: Implement range normalization for overlapping and contiguous HTTP Range headers ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28021/files - new: https://git.openjdk.org/jdk/pull/28021/files/83b1a2b4..f0c94e81 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=08-09 Stats: 62 lines in 3 files changed: 46 ins; 1 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/28021.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28021/head:pull/28021 PR: https://git.openjdk.org/jdk/pull/28021 From duke at openjdk.org Tue Nov 4 13:40:39 2025 From: duke at openjdk.org (Peyang) Date: Tue, 4 Nov 2025 13:40:39 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v6] In-Reply-To: References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> <9dX_Pl6xcwpO1YgLTj_L3qkGj_Dgrbo3VS3iiztbejo=.bdd88636-83dd-44cf-8edc-c4f8fcfa1ca4@github.com> Message-ID: On Mon, 3 Nov 2025 10:10:50 GMT, Michael McMahon wrote: >> The `ranges` list in the arguments is constructed so that each range's end option does not exceed the file size: if a requested range goes beyond the file lengh, it is clamped accordingly. >> Therefore, I don't think any foundamental change is needed here. >> >> We could add an `assert` (and a comment) to make this assumption explict, or possibly throw an IOE in case the file was truncated or modified during sending. > > I definitely don't want code that allows a `Content-Range: bytes 1000-2000` to be written and treated as normal if the file hits EOF 10 bytes short. Even if the situation cannot arise due to higher level checks, I'd like to see IOE thrown rather than breaking from the loop. Thanks for the clarification. I've updated the implementation accordingly. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2490551797 From jpai at openjdk.org Tue Nov 4 13:50:21 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 4 Nov 2025 13:50:21 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 10:53:44 GMT, Volkan Yazici wrote: > `java.net.Socket::setPerformancePreferences` was introduced in Java 1.5 with the intention of providing a declarative API for configuring the performance-wise characteristics of the underlying socket. It has always been a no-op and a corpus search does not reveal any significant usages of it. Recently merged [JDK-8366575] removes the SDP (Sockets Direct Protocol) support, and this further undermines the value of `setPerformancePreferences`. This PR deprecates `setPerformancePreferences` and friends _for removal_. > > [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 This looks good to me. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28129#pullrequestreview-3416562326 From alanb at openjdk.org Tue Nov 4 13:58:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 4 Nov 2025 13:58:46 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 10:53:44 GMT, Volkan Yazici wrote: > `java.net.Socket::setPerformancePreferences` was introduced in Java 1.5 with the intention of providing a declarative API for configuring the performance-wise characteristics of the underlying socket. It has always been a no-op and a corpus search does not reveal any significant usages of it. Recently merged [JDK-8366575] removes the SDP (Sockets Direct Protocol) support, and this further undermines the value of `setPerformancePreferences`. This PR deprecates `setPerformancePreferences` and friends _for removal_. > > [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 src/java.base/share/classes/java/net/ServerSocket.java line 951: > 949: * @since 1.5 > 950: */ > 951: @Deprecated(since = "26", forRemoval = true) Are you planning to add a `@deprecated` comment to these methods? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28129#discussion_r2490619726 From duke at openjdk.org Tue Nov 4 14:08:25 2025 From: duke at openjdk.org (Peyang) Date: Tue, 4 Nov 2025 14:08:25 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v6] In-Reply-To: <0v49K19iLf33_xI6mfN5l3BziRkCPUqeIoiyCp8lRa0=.2230a7d3-7ebc-44e6-9e08-d2d5422bdfc7@github.com> References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> <0v49K19iLf33_xI6mfN5l3BziRkCPUqeIoiyCp8lRa0=.2230a7d3-7ebc-44e6-9e08-d2d5422bdfc7@github.com> Message-ID: On Mon, 3 Nov 2025 15:58:37 GMT, Daniel Fuchs wrote: >> I implemented a check that validates whether the ranges are in ascendnig order and non-overlapping, returning an error if they are not. >> However, I have some concerns: this restriction might be too strict. >> >> Instead of outright rejecting requests with overlapping or unsorted ranges, what if the server simply combines overlapping ranges and sorts them before returning? >> According to [RFC 7233 ?15.3.7.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.7.2-4): >>> When multiple ranges are requested, a server **MAY** coalesce any of the ranges that overlap, or that are separated by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the corresponding range-spec appeared in the received [Range](https://www.rfc-editor.org/rfc/rfc9110.html#field.range) header field. >> >> In other words, rather than strictly validating and rejecting, we could treat this as an efficiency optimization on the server side. I think this approach would be more practical. I?d like to hear your thoughts on this. > > That would be fine too. I updated the implementation to merge overlapping or unsorted ranges and sort them before returning, instead of rejecting. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28021#discussion_r2490654650 From duke at openjdk.org Tue Nov 4 14:08:24 2025 From: duke at openjdk.org (Peyang) Date: Tue, 4 Nov 2025 14:08:24 GMT Subject: RFR: 8355572: Support HTTP Range requests in Simple Web Server [v11] In-Reply-To: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> References: <2Lue7uj_ciz7rRsleMm4w5VJ1UFGsAdqpADjkVnC-O0=.793be549-e1e8-40a6-836d-b562d6b9f308@github.com> Message-ID: > Hi all, > > [JEP 408](https://openjdk.org/jeps/408) introduced the Simple Web Server in Java 18, providing a minimal webserver for serving static files over HTTP. > > [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-range-requests) defines "Range Requests" as an optional feature that allows clients to request a subset of a resource's content. Supporting Range requests in the context of JDK's Simple Web Server means enabling the server to serve only the requested portion of a static file. > > This change contains: > > 1. Enhances `sun.net.httpserver.simpleserver.FileServerHandler` in the `jdk.httpserver` module to support `Range` and `If-Range` headers. > 2. Calculates an `ETag` for each resource based on its last-modified date and file size and sends it to the client on demand for use with the `If-Range` header. > 3. Returns the `Accept-Ranges` header for all file retrievals, and `Content-Range` when a client requests a specific range. > 4. Adds a new constant `HTTP_RANGE_NOT_SATISFIABLE` to the `Codes` class to indicate invalid ranges. > 5. Returns `206 Partial Content` for valid ranges and `416 Range Not Satisfiable` for invalid ranges. > 6. Includes corresponding tests to verify correct behavior. > > This enhancement was motivated by recent discussions on the net-dev mailing list, which requested support for Range requests along with example use cases: https://mail.openjdk.org/pipermail/net-dev/2025-April/026364.html > It was also discussed briefly on the net-dev mailing list: https://mail.openjdk.org/pipermail/net-dev/2025-October/028586.html Peyang has updated the pull request incrementally with one additional commit since the last revision: Throw IOException on unexpected EOF while reading file in FileServerHandler ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28021/files - new: https://git.openjdk.org/jdk/pull/28021/files/f0c94e81..2540945c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28021&range=09-10 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28021.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28021/head:pull/28021 PR: https://git.openjdk.org/jdk/pull/28021 From michaelm at openjdk.org Tue Nov 4 14:17:44 2025 From: michaelm at openjdk.org (Michael McMahon) Date: Tue, 4 Nov 2025 14:17:44 GMT Subject: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability Message-ID: I'd like to return to this issue with a new PR that addresses the usability issue minimally. Namely to define numeric constants for the counter-intuitive responseLength values in `HttpExchange.sendResponseHeaders`. The apidoc then refers to the constant names rather than the numeric values. I've updated the implementation and some tests (though not all yet) to use the constant names. I'm open to suggestions on the names themselves. Once that is agreed, I'll update the remaining tests and any other call sites in the implementation. Thanks, Michael ------------- Commit messages: - implementation and test - Merge branch 'master' into httpserver-8368955 - doc update Changes: https://git.openjdk.org/jdk/pull/28132/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28132&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8331195 Stats: 60 lines in 9 files changed: 29 ins; 3 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/28132.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28132/head:pull/28132 PR: https://git.openjdk.org/jdk/pull/28132 From dfuchs at openjdk.org Tue Nov 4 14:53:18 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 14:53:18 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v2] In-Reply-To: References: Message-ID: <3c3Z9mIQqMhuJ4JPwCQIgLOa1t_SMqNoHhfLv-tAuvc=.f7a1d132-2015-4bab-8219-ef2914e0a9ef@github.com> > This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. > > The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. Daniel Fuchs has updated the pull request incrementally with two additional commits since the last revision: - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27827/files - new: https://git.openjdk.org/jdk/pull/27827/files/0602a405..8a53537c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27827.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27827/head:pull/27827 PR: https://git.openjdk.org/jdk/pull/27827 From duke at openjdk.org Tue Nov 4 14:53:24 2025 From: duke at openjdk.org (Oumaiyma Intissar) Date: Tue, 4 Nov 2025 14:53:24 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode Message-ID: Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. **Problem** Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. **Fix** - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). **Compatibility** Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. **Testing** New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. ------------- Commit messages: - 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode Changes: https://git.openjdk.org/jdk/pull/27896/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27896&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367049 Stats: 81 lines in 3 files changed: 81 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27896.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27896/head:pull/27896 PR: https://git.openjdk.org/jdk/pull/27896 From alanb at openjdk.org Tue Nov 4 15:00:05 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 4 Nov 2025 15:00:05 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode In-Reply-To: References: Message-ID: <3S8LhaxwiUJhygb9PoiMlG42hoBYPxnPfzDzjgAm-hg=.f0078f2d-3393-42a8-b0e5-9f7dd191c61f@github.com> On Mon, 20 Oct 2025 12:12:56 GMT, Oumaiyma Intissar wrote: > Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. > > **Problem** > Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. > > **Fix** > - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. > - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). > - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). > > **Compatibility** > Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. > > **Testing** > New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. The title on the JBS issue and PR is a bit confusing. Opening a URL connection shouldn't use URLPermission anymore so I think the issue (in main line) is really with code that uses the deprecated URLPermission class directly. Would it be possible to confirm this, and if confirmed, can the JBS issue be renamed? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27896#issuecomment-3486404798 From dfuchs at openjdk.org Tue Nov 4 15:02:58 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:02:58 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v3] In-Reply-To: References: Message-ID: > This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. > > The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. Daniel Fuchs has updated the pull request incrementally with 11 additional commits since the last revision: - Apply suggestion from @dfuch - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java Co-authored-by: Volkan Yaz?c? - ... and 1 more: https://git.openjdk.org/jdk/compare/8a53537c...3a0b2a69 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27827/files - new: https://git.openjdk.org/jdk/pull/27827/files/8a53537c..3a0b2a69 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=01-02 Stats: 16 lines in 2 files changed: 0 ins; 0 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/27827.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27827/head:pull/27827 PR: https://git.openjdk.org/jdk/pull/27827 From dfuchs at openjdk.org Tue Nov 4 15:03:04 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:03:04 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v3] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 21:03:09 GMT, Volkan Yazici wrote: >> Daniel Fuchs has updated the pull request incrementally with 11 additional commits since the last revision: >> >> - Apply suggestion from @dfuch >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java >> >> Co-authored-by: Volkan Yaz?c? >> - ... and 1 more: https://git.openjdk.org/jdk/compare/8a53537c...3a0b2a69 > > test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 57: > >> 55: * @library /test/lib /test/jdk/java/net/httpclient/lib >> 56: * @build jdk.test.lib.net.SimpleSSLContext >> 57: * jdk.httpclient.test.lib.common.HttpServerAdapters > > @sormuras, in this JUnit test, given these `@build` classes are already included in `@library`, do we still need this explicit `@build`? All our tests do that and we had a few iterations before finding something that worked reliably. My2c is don't change it unless it starts causing trouble. > test/jdk/java/net/httpclient/http3/H3QuicVTTest.java line 206: > >> 204: .map(Thread::getName) >> 205: .toList()); >> 206: boolean found = threads.contains(name); > > Using thread name for this check looks very fragile. Can we devise a more programmatic method? E.g., ensuring no `StackTraceElement` contains `QuicSelectorThread`? It's a bit fragile but if we change the name of the thread we will just have to change the test. Looking through the stack trace elements could be more fragile. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2490834901 PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2490818481 From dfuchs at openjdk.org Tue Nov 4 15:03:00 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:03:00 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v3] In-Reply-To: References: Message-ID: <57cho0KYJQei2tcO-N2hkR6qT9BGS8OtxmmqgmLHLgc=.706d4797-cde8-40e6-970f-b924ed5dc76d@github.com> On Tue, 4 Nov 2025 15:00:13 GMT, Daniel Fuchs wrote: >> This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. >> >> The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. > > Daniel Fuchs has updated the pull request incrementally with 11 additional commits since the last revision: > > - Apply suggestion from @dfuch > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - Update test/jdk/java/net/httpclient/http3/H3QuicVTTest.java > > Co-authored-by: Volkan Yaz?c? > - ... and 1 more: https://git.openjdk.org/jdk/compare/8a53537c...3a0b2a69 src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicEndpoint.java line 148: > 146: MAX_BUFFERED_LOW = maxBufferLow; > 147: String useVtForSelector = > 148: System.getProperty("jdk.internal.httpclient.quic.useVTForSelector", "default"); Suggestion: System.getProperty("jdk.internal.httpclient.quic.selector.useVirtualThreads", "default"); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2490853880 From dfuchs at openjdk.org Tue Nov 4 15:16:13 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:16:13 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v4] In-Reply-To: References: Message-ID: > This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. > > The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. Daniel Fuchs has updated the pull request incrementally with three additional commits since the last revision: - Apply suggestion from @vy Co-authored-by: Volkan Yaz?c? - Apply suggestion from @vy Co-authored-by: Volkan Yaz?c? - Update the test to match the new property name ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27827/files - new: https://git.openjdk.org/jdk/pull/27827/files/3a0b2a69..f5a05218 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27827&range=02-03 Stats: 13 lines in 1 file changed: 0 ins; 1 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/27827.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27827/head:pull/27827 PR: https://git.openjdk.org/jdk/pull/27827 From dfuchs at openjdk.org Tue Nov 4 15:16:15 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:16:15 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v4] In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 20:24:59 GMT, Volkan Yazici wrote: >> Daniel Fuchs has updated the pull request incrementally with three additional commits since the last revision: >> >> - Apply suggestion from @vy >> >> Co-authored-by: Volkan Yaz?c? >> - Apply suggestion from @vy >> >> Co-authored-by: Volkan Yaz?c? >> - Update the test to match the new property name > > src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicSelector.java line 510: > >> 508: } >> 509: >> 510: private record QuicSelectorThread(Thread thread) { > > AFAICS, all methods ? `start()`, `join()`, `ofPlatform()`, `ofVirtual()`, and `of()` ? can be `private`. You're not wrong, but I prefer to keep them package to distinguish betwen methods that should only be called from with the record class itself as opposed to methods that are designed to be called from the enclosing class, or other classes in the nest. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27827#discussion_r2490903516 From dfuchs at openjdk.org Tue Nov 4 15:36:10 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:36:10 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v6] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 11:04:38 GMT, Volkan Yazici wrote: >> Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Use `

` in Javadoc as suggested in reviews src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 39: > 37: * This class is immutable and thread-safe. > 38: *

> 39: * Operations that add durations to a {@code Deadline}, whether represented as a Suggestion: * Operations that add or subtract durations to a {@code Deadline}, whether represented as a src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 43: > 41: * nanoseconds) do not throw on numeric overflow if the resulting > 42: * {@code Deadline} would exceed {@link #MAX} or be less than {@link #MIN}. > 43: * Instead, {@code MAX} or {@code MIN} is returned, respectively. Suggestion: * Instead, {@code MAX} or {@code MIN} is returned, respectively. * Similarly, methods that return a duration as a {@code long} will either return * {@link Long#MAX_VALUE} or {@link Long#MIN_VALUE} if the returned quantity would * exceed the capacity of a {@code long}. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2490973411 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2490983462 From dfuchs at openjdk.org Tue Nov 4 15:38:05 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 15:38:05 GMT Subject: RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v3] In-Reply-To: References: <3uKkSjIMFIHxX6-4LmTsKakoC6DEG2s80eUw-4D8uoU=.00e81e1c-85d8-4bc7-be97-31aa7a406170@github.com> Message-ID: On Tue, 4 Nov 2025 11:11:26 GMT, EunHyunsu wrote: >> Fixes JDK-8371009. >> >> The synchronous HttpClient example references `request` without defining it. >> This patch adds a minimal HttpRequest initialization immediately before the >> synchronous example (mirroring the asynchronous snippet) so the example >> compiles and runs as-is. > > EunHyunsu has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8371009: fix indent Marked as reviewed by dfuchs (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28084#pullrequestreview-3417147285 From dfuchs at openjdk.org Tue Nov 4 16:05:20 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 16:05:20 GMT Subject: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 14:10:14 GMT, Michael McMahon wrote: > I'd like to return to this issue with a new PR that addresses the usability issue minimally. Namely to define numeric constants > for the counter-intuitive responseLength values in `HttpExchange.sendResponseHeaders`. The apidoc then refers to the constant names rather than the numeric values. > > I've updated the implementation and some tests (though not all yet) to use the constant names. I'm open to suggestions on the names themselves. Once that is agreed, I'll update the remaining tests and any other call sites in the implementation. > > Thanks, > Michael This is a good idea, but it kind of hides the fact that passing 0 may not do what you think it does. Typically the pitfall is to assume that if you have an array of bytes then you can can call `sendResponseHeaders` with the array length. The API doc of `sendResponseHeaders` should probably make it clear that 0 is a special value, and that `RSPBODY_CHUNKED` is 0. In addition I would suggest adding code snipets showing both cases (one using a byte array and passing `bytes.length == 0 ? RSPBODY_EMPTY : bytes.length` and the other using `RSPBODY_CHUNKED` with e.g. transferring the content of an `InputStream`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28132#issuecomment-3486767513 From dfuchs at openjdk.org Tue Nov 4 16:11:29 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 16:11:29 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 12:12:56 GMT, Oumaiyma Intissar wrote: > Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. > > **Problem** > Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. > > **Fix** > - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. > - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). > - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). > > **Compatibility** > Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. > > **Testing** > New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. test/jdk/java/net/URLPermission/EmptyAuthorityTest.java line 69: > 67: new URLPermission(url); // should not throw > 68: } > 69: } Please add a new line at the end of the file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27896#discussion_r2491130629 From duke at openjdk.org Tue Nov 4 16:11:39 2025 From: duke at openjdk.org (Peyang) Date: Tue, 4 Nov 2025 16:11:39 GMT Subject: Integrated: 8371092: NullPointerException in AltServiceUsageTest.afterClass() test In-Reply-To: References: Message-ID: On Sun, 2 Nov 2025 14:09:28 GMT, Peyang wrote: > - Add `safeClose(DatagramChannel)` to close udpNotResponding safely. > - Null-check and exception handling unified with `safeStop()`. > - Ensures test cleanup never fails due to uninitialized or problematic channel. This pull request has now been integrated. Changeset: 2f455ed1 Author: Peyang Committer: Daniel Fuchs URL: https://git.openjdk.org/jdk/commit/2f455ed146ff2e56da4532e9430e4c85ca9497ad Stats: 14 lines in 1 file changed: 13 ins; 0 del; 1 mod 8371092: NullPointerException in AltServiceUsageTest.afterClass() test Reviewed-by: dfuchs ------------- PR: https://git.openjdk.org/jdk/pull/28104 From coffeys at openjdk.org Tue Nov 4 16:22:31 2025 From: coffeys at openjdk.org (Sean Coffey) Date: Tue, 4 Nov 2025 16:22:31 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 12:12:56 GMT, Oumaiyma Intissar wrote: > Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. > > **Problem** > Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. > > **Fix** > - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. > - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). > - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). > > **Compatibility** > Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. > > **Testing** > New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. Looks fine to me ------------- Marked as reviewed by coffeys (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27896#pullrequestreview-3417395498 From michaelm at openjdk.org Tue Nov 4 16:26:55 2025 From: michaelm at openjdk.org (Michael McMahon) Date: Tue, 4 Nov 2025 16:26:55 GMT Subject: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 16:02:41 GMT, Daniel Fuchs wrote: > This is a good idea, but it kind of hides the fact that passing 0 may not do what you think it does. > > Typically the pitfall is to assume that if you have an array of bytes then you can can call `sendResponseHeaders` with the array length. The API doc of `sendResponseHeaders` should probably make it clear that 0 is a special value, and that `RSPBODY_CHUNKED` is 0. > Actually, that case is not so bad. What happens is that chunked encoding is selected but the response body content is empty as intended, and it should work. But, maybe we should still highlight it anyway. > In addition I would suggest adding code snipets showing both cases (one using a byte array and passing `bytes.length == 0 ? RSPBODY_EMPTY : bytes.length` and the other using `RSPBODY_CHUNKED` with e.g. transferring the content of an `InputStream`. The worse case is expecting a negative value to mean an indefinite (chunked encoded) length. You definitely don't get what you expect in that case. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28132#issuecomment-3486869930 From dfuchs at openjdk.org Tue Nov 4 17:08:47 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 17:08:47 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 12:12:56 GMT, Oumaiyma Intissar wrote: > Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. > > **Problem** > Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. > > **Fix** > - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. > - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). > - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). > > **Compatibility** > Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. > > **Testing** > New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. I agree with Alan that we should update the JBS issue title to match what is being fixed. `URL.openConnection` does not throw in JDK 24 and later. `URLPermission` still does. Otherwise the proposed fix looks reasonable. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27896#issuecomment-3487087557 From vyazici at openjdk.org Tue Nov 4 17:32:48 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 17:32:48 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences [v2] In-Reply-To: References: Message-ID: > `java.net.Socket::setPerformancePreferences` was introduced in Java 1.5 with the intention of providing a declarative API for configuring the performance-wise characteristics of the underlying socket. It has always been a no-op and a corpus search does not reveal any significant usages of it. Recently merged [JDK-8366575] removes the SDP (Sockets Direct Protocol) support, and this further undermines the value of `setPerformancePreferences`. This PR deprecates `setPerformancePreferences` and friends _for removal_. > > [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Improve Javadoc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28129/files - new: https://git.openjdk.org/jdk/pull/28129/files/50826c3e..41c918cf Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28129&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28129&range=00-01 Stats: 9 lines in 3 files changed: 9 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28129.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28129/head:pull/28129 PR: https://git.openjdk.org/jdk/pull/28129 From vyazici at openjdk.org Tue Nov 4 17:32:50 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 17:32:50 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences [v2] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 13:55:41 GMT, Alan Bateman wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Improve Javadoc > > src/java.base/share/classes/java/net/ServerSocket.java line 951: > >> 949: * @since 1.5 >> 950: */ >> 951: @Deprecated(since = "26", forRemoval = true) > > Are you planning to add a `@deprecated` comment to these methods? I was not intending to, but added in 41c918cfa60 after your nudge. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28129#discussion_r2491445107 From duke at openjdk.org Tue Nov 4 17:37:24 2025 From: duke at openjdk.org (Oumaiyma Intissar) Date: Tue, 4 Nov 2025 17:37:24 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode [v2] In-Reply-To: References: Message-ID: > Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. > > **Problem** > Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. > > **Fix** > - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. > - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). > - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). > > **Compatibility** > Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. > > **Testing** > New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. Oumaiyma Intissar has updated the pull request incrementally with one additional commit since the last revision: Fix missing newline at end of EmptyAuthorityTest.java Add missing newline at the end of the file. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27896/files - new: https://git.openjdk.org/jdk/pull/27896/files/1d28e6fd..a4089913 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27896&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27896&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27896.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27896/head:pull/27896 PR: https://git.openjdk.org/jdk/pull/27896 From duke at openjdk.org Tue Nov 4 17:37:26 2025 From: duke at openjdk.org (Oumaiyma Intissar) Date: Tue, 4 Nov 2025 17:37:26 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode In-Reply-To: <3S8LhaxwiUJhygb9PoiMlG42hoBYPxnPfzDzjgAm-hg=.f0078f2d-3393-42a8-b0e5-9f7dd191c61f@github.com> References: <3S8LhaxwiUJhygb9PoiMlG42hoBYPxnPfzDzjgAm-hg=.f0078f2d-3393-42a8-b0e5-9f7dd191c61f@github.com> Message-ID: On Tue, 4 Nov 2025 14:56:53 GMT, Alan Bateman wrote: > The title on the JBS issue and PR is a bit confusing. Opening a URL connection shouldn't use URLPermission anymore so I think the issue (in main line) is really with code that uses the deprecated URLPermission class directly. Would it be possible to confirm this, and if confirmed, can the JBS issue be renamed? Thank you for your feedback. The issue was reported specifically for JDK 17, so the current JBS issue title accurately reflects the context and version concerned. While the root cause is with `URLPermission` and `HostPortrange` (which still exist in the main line) the title needs to remain as is to properly indicate that this is a JDK 17 issue. The planned approach is to address and fix the issue in the main line first. Once resolved, the fix will then be backported to JDK 17 and other affected releases. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27896#issuecomment-3487242775 From alanb at openjdk.org Tue Nov 4 17:53:39 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 4 Nov 2025 17:53:39 GMT Subject: RFR: 8367049: URL.openConnection throws StringIndexOutOfBoundsException in avm mode [v2] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 17:37:24 GMT, Oumaiyma Intissar wrote: >> Constructing URLPermission with an empty/missing host in the authority (e.g., `"http:///path"`) could throw `StringIndexOutOfBoundsException`. >> >> **Problem** >> Empty or malformed authorities reach HostPortrange, which does `charAt(0)` without checking, causing `StringIndexOutOfBoundsException`. >> >> **Fix** >> - `URLPermission.Authority`: after stripping userinfo, fail fast if host part is empty. >> - `HostPortrange`: add guards for null/empty input and leading ':' (port without host). >> - No `HttpURLConnection` changes needed in JDK 26 (the `SecurityManager` permission path is gone). >> >> **Compatibility** >> Only affects malformed inputs: previously `StringIndexOutOfBoundsException`, now `IllegalArgumentException`. Valid inputs unaffected. >> >> **Testing** >> New jtreg test: `test/jdk/java/net/URLPermission/EmptyAuthorityTest.java` verifies `IllegalArgumentException` for malformed authorities and success for valid ones. > > Oumaiyma Intissar has updated the pull request incrementally with one additional commit since the last revision: > > Fix missing newline at end of EmptyAuthorityTest.java > > Add missing newline at the end of the file. I've renamed the JBS issue as it is too confusing to target main line with commit suggestion URLConnection then it's an issue with the deprecated URLPermission. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27896#issuecomment-3487341152 From dfuchs at openjdk.org Tue Nov 4 18:01:36 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 18:01:36 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v8] In-Reply-To: References: Message-ID: <5f7komVMjMAg3Dck_trHLmn-gUOJp3nOCFlzkPa9NJM=.76449183-c2e4-4b7a-ae5b-c71c9d954a51@github.com> On Mon, 3 Nov 2025 14:36:26 GMT, Volkan Yazici wrote: >> Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body. >> >> ### Review guidelines >> >> 1. Read _"the fix"_ in `MultiExchange` >> 2. Skim through the test server *handler* in `TimeoutResponseTestSupport` >> 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!) > > Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 31 commits: > > - Shorten `TimeoutResponseTestSupport` using imports > - Make `MultiExchange::cancelTimer` package-private > - Merge remote-tracking branch 'upstream/master' into respBodyTime > - Simplify Javadoc > - Merge remote-tracking branch 'upstream/master' into respBodyTime > - Improve `HttpBodySubscriberWrapper::onTermination` JavaDoc > - Mark `SubscriptionWrapper` as `final` > - Replace wrapper's `preTerminationCallback` argument with a method to be extended > - Fix `HttpClient` doc typo > - Invoke `preTerminationCallback` at `cancel()` too > - ... and 21 more: https://git.openjdk.org/jdk/compare/ef464d69...55396846 src/java.net.http/share/classes/java/net/http/WebSocket.java line 151: > 149: * moment a connection is requested until it is established. The elapsed > 150: * time includes any SSL/TLS handshake. > 151: * This change should probably be ammended. The connectionTimeout for websocket is set as the request timeout for the HTTP upgrade request to websocket. So it includes both the handshake and the 101 response. Now I wonder if we are missing something that will cancel the timer when handing the connection off to WebSocket. It would be good to double check. We had no failing tests so maybe this is properly handled. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2491576541 From dfuchs at openjdk.org Tue Nov 4 18:10:42 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 18:10:42 GMT Subject: RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v8] In-Reply-To: <5f7komVMjMAg3Dck_trHLmn-gUOJp3nOCFlzkPa9NJM=.76449183-c2e4-4b7a-ae5b-c71c9d954a51@github.com> References: <5f7komVMjMAg3Dck_trHLmn-gUOJp3nOCFlzkPa9NJM=.76449183-c2e4-4b7a-ae5b-c71c9d954a51@github.com> Message-ID: On Tue, 4 Nov 2025 17:58:15 GMT, Daniel Fuchs 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 31 commits: >> >> - Shorten `TimeoutResponseTestSupport` using imports >> - Make `MultiExchange::cancelTimer` package-private >> - Merge remote-tracking branch 'upstream/master' into respBodyTime >> - Simplify Javadoc >> - Merge remote-tracking branch 'upstream/master' into respBodyTime >> - Improve `HttpBodySubscriberWrapper::onTermination` JavaDoc >> - Mark `SubscriptionWrapper` as `final` >> - Replace wrapper's `preTerminationCallback` argument with a method to be extended >> - Fix `HttpClient` doc typo >> - Invoke `preTerminationCallback` at `cancel()` too >> - ... and 21 more: https://git.openjdk.org/jdk/compare/ef464d69...55396846 > > src/java.net.http/share/classes/java/net/http/WebSocket.java line 151: > >> 149: * moment a connection is requested until it is established. The elapsed >> 150: * time includes any SSL/TLS handshake. >> 151: * > > This change should probably be ammended. > The connectionTimeout for websocket is set as the request timeout for the HTTP upgrade request to websocket. > So it includes both the handshake and the 101 response. > Now I wonder if we are missing something that will cancel the timer when handing the connection off to WebSocket. It would be good to double check. We had no failing tests so maybe this is properly handled. And now I wonder too when the timer gets cancelled for an HTTP/2 upgrade. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2491604215 From vyazici at openjdk.org Tue Nov 4 18:21:27 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 18:21:27 GMT Subject: RFR: 8369920: HttpClient QuicSelectorThread could be a VirtualThread [v4] In-Reply-To: References: Message-ID: <0PjL2ziQeIrOvlinGDl8TpDQLzvESWAqZM3LsIz6W4A=.3c528447-b82b-496f-ad46-663f12b7c193@github.com> On Tue, 4 Nov 2025 15:16:13 GMT, Daniel Fuchs wrote: >> This change makes it possible to use a VirtualThread for the QuicSelectorThread. The default will be to use a VirtualThread on all platforms except the Windows platform. We might consider switching the default for Windows platform too once [JDK-8334574](https://bugs.openjdk.org/browse/JDK-8334574) is fixed. >> >> The change should be transparent for users of the API. However, using a VirtualThread may result in subtle differences in thread scheduling and class loading, so this change also includes an escape hatch (a non documented internal system property) that could be used to revert to a platform thread in case of unexpected issues. That property may be removed in a future version of the JDK. > > Daniel Fuchs has updated the pull request incrementally with three additional commits since the last revision: > > - Apply suggestion from @vy > > Co-authored-by: Volkan Yaz?c? > - Apply suggestion from @vy > > Co-authored-by: Volkan Yaz?c? > - Update the test to match the new property name Marked as reviewed by vyazici (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27827#pullrequestreview-3418072752 From vyazici at openjdk.org Tue Nov 4 18:26:34 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 18:26:34 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v7] In-Reply-To: References: Message-ID: <4jUf69B2EbyUZV-kYQCODDcEtQ4el1lc25wO3B4XS5E=.97f45db3-d7c7-4f3c-8cef-a2c5f0f30076@github.com> > Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Clarify Javadoc on extremums ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27973/files - new: https://git.openjdk.org/jdk/pull/27973/files/2634e743..167d3b97 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=05-06 Stats: 7 lines in 1 file changed: 3 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27973.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27973/head:pull/27973 PR: https://git.openjdk.org/jdk/pull/27973 From vyazici at openjdk.org Tue Nov 4 18:26:37 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 18:26:37 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v6] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 15:28:02 GMT, Daniel Fuchs wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Use `

` in Javadoc as suggested in reviews > > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 39: > >> 37: * This class is immutable and thread-safe. >> 38: *

>> 39: * Operations that add durations to a {@code Deadline}, whether represented as a > > Suggestion: > > * Operations that add or subtract durations to a {@code Deadline}, whether represented as a Applied in 167d3b973c2. > src/java.net.http/share/classes/jdk/internal/net/http/common/Deadline.java line 43: > >> 41: * nanoseconds) do not throw on numeric overflow if the resulting >> 42: * {@code Deadline} would exceed {@link #MAX} or be less than {@link #MIN}. >> 43: * Instead, {@code MAX} or {@code MIN} is returned, respectively. > > Suggestion: > > * Instead, {@code MAX} or {@code MIN} is returned, respectively. > * Similarly, methods that return a duration as a {@code long} will either return > * {@link Long#MAX_VALUE} or {@link Long#MIN_VALUE} if the returned quantity would > * exceed the capacity of a {@code long}. Applied in 167d3b973c2. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2491642861 PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2491643264 From dfuchs at openjdk.org Tue Nov 4 18:43:49 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Tue, 4 Nov 2025 18:43:49 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v7] In-Reply-To: <4jUf69B2EbyUZV-kYQCODDcEtQ4el1lc25wO3B4XS5E=.97f45db3-d7c7-4f3c-8cef-a2c5f0f30076@github.com> References: <4jUf69B2EbyUZV-kYQCODDcEtQ4el1lc25wO3B4XS5E=.97f45db3-d7c7-4f3c-8cef-a2c5f0f30076@github.com> Message-ID: <9TrMi4K1sue2VjsFBHljpjSUOjGJN8eGZKnIg3Kxxpk=.97d6a28e-25ad-4377-820d-2e4fe8bdeed6@github.com> On Tue, 4 Nov 2025 18:26:34 GMT, Volkan Yazici wrote: >> Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Clarify Javadoc on extremums test/jdk/java/net/httpclient/DurationOverflowTest.java line 88: > 86: * @run junit/othervm > 87: * -Djdk.httpclient.keepalive.timeout.h2=9223372036854775807 > 88: * -DallowedInfras=h2,h2s you could probably add h3 since h3 takes its default value from h2. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2491689022 From alanb at openjdk.org Tue Nov 4 19:57:17 2025 From: alanb at openjdk.org (Alan Bateman) Date: Tue, 4 Nov 2025 19:57:17 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences [v2] In-Reply-To: References: Message-ID: <2cuzTthIX1oIW7Zv9oG4IvBSY1c_OV1k5HjP9JeynJg=.f3463afe-49d9-40b2-9081-47c8b65048a6@github.com> On Tue, 4 Nov 2025 17:32:48 GMT, Volkan Yazici wrote: >> `java.net.Socket::setPerformancePreferences` was introduced in Java 1.5 with the intention of providing a declarative API for configuring the performance-wise characteristics of the underlying socket. It has always been a no-op and a corpus search does not reveal any significant usages of it. Recently merged [JDK-8366575] removes the SDP (Sockets Direct Protocol) support, and this further undermines the value of `setPerformancePreferences`. This PR deprecates `setPerformancePreferences` and friends _for removal_. >> >> [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 > > Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: > > Improve Javadoc src/java.base/share/classes/java/net/SocketImpl.java line 362: > 360: * > 361: * @deprecated This function has always been a no-op. > 362: * It is deprecated for removal without any replacement. The method description already has "By default, this method does nothing, unless it is overridden in a sub-class". What would you think about have the deprecated message be reduced down to "This method was intended to allow for protocols that are now obsolete"? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28129#discussion_r2491879876 From vyazici at openjdk.org Tue Nov 4 20:04:27 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 20:04:27 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences [v3] In-Reply-To: References: Message-ID: > `java.net.Socket::setPerformancePreferences` was introduced in Java 1.5 with the intention of providing a declarative API for configuring the performance-wise characteristics of the underlying socket. It has always been a no-op and a corpus search does not reveal any significant usages of it. Recently merged [JDK-8366575] removes the SDP (Sockets Direct Protocol) support, and this further undermines the value of `setPerformancePreferences`. This PR deprecates `setPerformancePreferences` and friends _for removal_. > > [JDK-8366575]: https://bugs.openjdk.org/browse/JDK-8366575 Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Shorten `@deprecated` message ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28129/files - new: https://git.openjdk.org/jdk/pull/28129/files/41c918cf..c9384b09 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28129&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28129&range=01-02 Stats: 6 lines in 3 files changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/28129.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28129/head:pull/28129 PR: https://git.openjdk.org/jdk/pull/28129 From vyazici at openjdk.org Tue Nov 4 20:04:29 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 20:04:29 GMT Subject: RFR: 8366577: Deprecate java.net.Socket::setPerformancePreferences [v2] In-Reply-To: <2cuzTthIX1oIW7Zv9oG4IvBSY1c_OV1k5HjP9JeynJg=.f3463afe-49d9-40b2-9081-47c8b65048a6@github.com> References: <2cuzTthIX1oIW7Zv9oG4IvBSY1c_OV1k5HjP9JeynJg=.f3463afe-49d9-40b2-9081-47c8b65048a6@github.com> Message-ID: On Tue, 4 Nov 2025 19:54:32 GMT, Alan Bateman wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Improve Javadoc > > src/java.base/share/classes/java/net/SocketImpl.java line 362: > >> 360: * >> 361: * @deprecated This function has always been a no-op. >> 362: * It is deprecated for removal without any replacement. > > The method description already has "By default, this method does nothing, unless it is overridden in a sub-class". What would you think about have the deprecated message be reduced down to "This method was intended to allow for protocols that are now obsolete"? Implemented in c9384b09ba9. I'm right away updating the CSR specification too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28129#discussion_r2491895289 From vyazici at openjdk.org Tue Nov 4 20:09:44 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 20:09:44 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v8] In-Reply-To: References: Message-ID: > Introduce necessary fixes to address exceptions thrown when excessive `Duration`s are provided to `Duration`-accepting `HttpClient` public APIs. Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: Test `h3` infra with `j.h.k.timeout.h2` ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27973/files - new: https://git.openjdk.org/jdk/pull/27973/files/167d3b97..a1163b58 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27973&range=06-07 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27973.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27973/head:pull/27973 PR: https://git.openjdk.org/jdk/pull/27973 From vyazici at openjdk.org Tue Nov 4 20:09:47 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Tue, 4 Nov 2025 20:09:47 GMT Subject: RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v7] In-Reply-To: <9TrMi4K1sue2VjsFBHljpjSUOjGJN8eGZKnIg3Kxxpk=.97d6a28e-25ad-4377-820d-2e4fe8bdeed6@github.com> References: <4jUf69B2EbyUZV-kYQCODDcEtQ4el1lc25wO3B4XS5E=.97f45db3-d7c7-4f3c-8cef-a2c5f0f30076@github.com> <9TrMi4K1sue2VjsFBHljpjSUOjGJN8eGZKnIg3Kxxpk=.97d6a28e-25ad-4377-820d-2e4fe8bdeed6@github.com> Message-ID: On Tue, 4 Nov 2025 18:40:46 GMT, Daniel Fuchs wrote: >> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision: >> >> Clarify Javadoc on extremums > > test/jdk/java/net/httpclient/DurationOverflowTest.java line 88: > >> 86: * @run junit/othervm >> 87: * -Djdk.httpclient.keepalive.timeout.h2=9223372036854775807 >> 88: * -DallowedInfras=h2,h2s > > you could probably add h3 since h3 takes its default value from h2. Implemented in a1163b58b88. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27973#discussion_r2491904855 From michaelm at openjdk.org Tue Nov 4 21:22:18 2025 From: michaelm at openjdk.org (Michael McMahon) Date: Tue, 4 Nov 2025 21:22:18 GMT Subject: RFR: 8331195: Improve com.sun.net.httpserver.HttpExchange usability [v2] In-Reply-To: References: Message-ID: > I'd like to return to this issue with a new PR that addresses the usability issue minimally. Namely to define numeric constants > for the counter-intuitive responseLength values in `HttpExchange.sendResponseHeaders`. The apidoc then refers to the constant names rather than the numeric values. > > I've updated the implementation and some tests (though not all yet) to use the constant names. I'm open to suggestions on the names themselves. Once that is agreed, I'll update the remaining tests and any other call sites in the implementation. > > Thanks, > Michael Michael McMahon has updated the pull request incrementally with one additional commit since the last revision: doc update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28132/files - new: https://git.openjdk.org/jdk/pull/28132/files/8fe3a2bd..5f9f259d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28132&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28132&range=00-01 Stats: 13 lines in 1 file changed: 12 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28132.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28132/head:pull/28132 PR: https://git.openjdk.org/jdk/pull/28132