On Fri, 4 Apr 2025 10:40:24 GMT, Eirik Bjørsnøs <eir...@openjdk.org> wrote:

> @dfuch Tagnential observation: `proxyServer.stop(2)` will always wait 2 
> seconds here. I was assuming it would only do that if there was an ongoing 
> exchange.
> 
> Looking at the `ServerImpl` class, it looks like `finished` is never set to 
> true. Specifically, `ServerImpl.Dispatcher::handleEvent` does not set it to 
> true since that happens before `terminating` is set to true.
> 
> How is `HttpServer::stop` expected to work? Is something wrong with my 
> expectations that this should return quickly with no inflight exchanges?

Interesting. That looks like a bug to me. stop() should probably look at 
`exchangeCount` too - but that will require some thinking to get the 
asynchronous stops to work correctly. Should be worth logging a bug :-)

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

PR Comment: https://git.openjdk.org/jdk/pull/24418#issuecomment-2778350297

Reply via email to