RFR: 8368528: HttpClient.Builder.connectTimeout should accept arbitrarily large values [v5]

Volkan Yazici vyazici at openjdk.org
Tue Nov 4 11:04:53 UTC 2025


On Mon, 3 Nov 2025 14:30:28 GMT, Daniel Fuchs <dfuchs at openjdk.org> 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:
> 
>  * <p id="overflow"> 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:      * <p>
>> 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:      * <p>
>> 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:      * <p>
>> 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:      * <p>
>> 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:      * <p>
>> 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:      * <p>
>> 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


More information about the net-dev mailing list