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

Daniel Fuchs dfuchs at openjdk.org
Mon Jun 9 14:25:57 UTC 2025


On Fri, 6 Jun 2025 14:58:47 GMT, p-nima <duke 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.
>
> p-nima has updated the pull request incrementally with one additional commit since the last revision:
> 
>   update summary

test/jdk/java/net/httpclient/HttpClientAuthRetryLimitTest.java line 132:

> 130:                 assertEquals("too many authentication attempts. Limit: " + RETRY_LIMIT, exception.getMessage());
> 131:                 assertEquals(RETRY_LIMIT > 0 ? RETRY_LIMIT : 0,
> 132:                         RETRY_LIMIT > 0 ? requestCount.get():requestCount.decrementAndGet());

Could you split that in two statements for better readability? The double ternary operator makes it difficult to parse.


    if (RETRY_LIMIT > 0) {
        assertEquals(...);
    } else {
        assertEquals(...);
    }

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

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


More information about the net-dev mailing list