8330572: jdk.internal.net.http.HttpConnection calls an expensive checkOpen() when returning a HTTP/1.1 connection to the pool

Reviewed-by: dfuchs, djelinski
This commit is contained in:
Jaikiran Pai 2024-04-19 10:07:25 +00:00
parent 8990864a53
commit 9f2a4fad17

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -409,7 +409,7 @@ abstract class HttpConnection implements Closeable {
.map((s) -> !s.equalsIgnoreCase("close"))
.orElse(true);
if (keepAlive && checkOpen()) {
if (keepAlive && isOpen()) {
Log.logTrace("Returning connection to the pool: {0}", this);
pool.returnToPool(this);
} else {