RFR: 8340182: Java HttpClient does not follow default retry limit of 3 retries

Daniel Fuchs dfuchs at openjdk.org
Wed Jun 4 13:16:18 UTC 2025


On Wed, 28 May 2025 12:46:25 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> The AuthenticationFilter did not respect the default retry limit of 3 retries in case of invalid credentials supplied.
>> 
>> This PR helps to resolve the bug and tests it with default and updated retry limit set via `jdk.httpclient.auth.retrylimit=1`.
>> 
>> The test is green with tiers 1, 2, 3 and the test is stable.
>
> test/jdk/java/net/httpclient/HttpClientRetryLimitTest.java line 34:
> 
>> 32:  * @build jdk.httpclient.test.lib.http2.Http2TestServer
>> 33:  * @run junit HttpClientRetryLimitTest
>> 34:  * @run junit/othervm -Djdk.httpclient.auth.retrylimit=1 HttpClientRetryLimitTest
> 
> @dfuch, shall we test against zero and negative values too? (Both are accepted by `AuthenticationFilter` as valid.)

We could. We could also throw in garbage to see what happens.

> test/jdk/java/net/httpclient/HttpClientRetryLimitTest.java line 57:
> 
>> 55: 
>> 56: 
>> 57: class HttpClientRetryLimitTest implements HttpServerAdapters {
> 
> Shall we rename this to `HttpClientAuthRetryLimit`, since [there are several other retry limits](https://docs.oracle.com/en/java/javase/23/docs/api/java.net.http/module-summary.html#jdk.httpclient.auth.retrylimit)?

Sounds reasonable to rename - and fix the `@summary` in the jtreg headers too

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25490#discussion_r2111954811
PR Review Comment: https://git.openjdk.org/jdk/pull/25490#discussion_r2116093435


More information about the net-dev mailing list