On Wed, 23 Apr 2025 10:18:44 GMT, Volkan Yazici <vyaz...@openjdk.org> wrote:
> Incorporates the test server name while deriving the HTTP/2 test server > (i.e., `jdk.httpclient.test.lib.http2.Http2TestServer`) thread names to > improve diagnostics. > > ### Making `HttpTestServer` implement `AutoCloseable` > > I carried out this out-of-scope enhancement along with this PR, since this > one-liner gives nice try-with-resources convenience while writing tests using > HTTP test servers. Note that [this change is already implemented for the > in-progress HTTP/3 > work](/dfuch/jdk/blob/9c2da664d2875b7e7986831fd716d05b7a8306f4/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java#L1119). > > ### Improving HTTP/2 test server thread names > > The HTTP/2 server thread names are improved by modifying the server default > executor to include the HTTP/2 server name in its thread names. We > deliberately did nothing for the HTTP/1.1 server (provided by the > `jdk.httpserver` module). `ServerImpl`, the default HTTP/1.1 server > implementation, has only one thread by default: the dispatcher and it is > named `HTTP-Dispatcher`. Since factory methods in > `com.sun.net.httpserver.Http[s]Server` don’t have the notion of a _name_, > introducing a name would require a public API change. > Instead the calling code that creates the server can supply an Executor which > creates threads with whatever name > is appropriate for the application/test. This pull request has now been integrated. Changeset: 7d9a4383 Author: Volkan Yazici <vyaz...@openjdk.org> Committer: Jaikiran Pai <j...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/7d9a43839ad190a53efdbcc7afd1728760c14e21 Stats: 28 lines in 2 files changed: 13 ins; 6 del; 9 mod 8355370: Include server name in HTTP test server thread names to improve diagnostics Reviewed-by: dfuchs, jpai ------------- PR: https://git.openjdk.org/jdk/pull/24822