On 11/10/2016 3:21 AM, Oleg Kalnichevski wrote: > On Wed, 2016-11-09 at 13:43 -0700, Shawn Heisey wrote: >> What happens to a long-lived HTTP connection if another thread calls >> close() on the HttpClient? Does the connection immediately die and >> throw an exception, or would the connection finish as expected in its >> own time? > Yes, it does. CloseableHttpClient#close immediately purges the > internal pool of all connections both active (leased) and inactive > (kept alive). HC 5.0 will support graceful shutdown option whereby one > can give connections some grace period to complete ongoing exchanges > prior to shutting down.
Thank you! I prefer to have everything shut down immediately, so this is good news. If the exception that happens in the background thread is different enough from exceptions indicating "real" problems, I will be able to detect that situation and log a short warning, instead of a full stacktrace. I will be on the lookout for this when I've written enough of the code to test it. Thanks, Shawn --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org