async-http-client
async-http-client copied to clipboard
Closing the client while request is in flight doesn't complete request's future.
- Kick off a request.
- Close the client by calling
AsyncHttpClient.close()before the request completes. - Observe that the request's future is never completed (the handler callback is never called either).
The expectation is that the client will complete the request future exceptionally (perhaps with java.nio.channels.ClosedChannelException or similar) after org.asynchttpclient.netty.channel.ChannelManager's termination future has completed.
This use case is not supported atm. You’re suppose to close the client only once you’re done. AHC doesn’t have a controller which would keep track of flying requests. That’s something you’d have to implement on your side.