On Thu, 27 Mar 2025 13:07:44 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Improve JavaDoc > > src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java > line 81: > >> 79: = Comparator.comparing(HttpConnection::id); >> 80: >> 81: private static final AtomicLong LABEL_COUNTER = new AtomicLong(); > > In the API documentation on `HttpResponse.connectionLabel()` we talk about > the connection label being unique within a `HttpClient` scope. i.e. two > different `HttpClient` instances could have the same connectionLabel for a > connection. I think that's the right scoping. > > So given that, having a `static` field on a `HttpConnection` which keeps > track of a connection label, may not be the right place to keep track of that > state. In this proposed form, no two connections in two different HttpClient > instances will ever have the same connectionLabel. I think this counter > should probably be present on the `HttpClientImpl` as an instance field. @jaikiran, what you're suggesting makes sense. I'm still exploring the interplay between the connection label and HTTP/3 server pushes. I will return back to your suggestion soon. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2023544640