-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse http client #62
base: master
Are you sure you want to change the base?
Conversation
…troying on ConnectException to avoid thread leak
Happy to hear! You're welcome.
I'll run some tests over the weekend and merge it if there are no problems. Your contribution is much appreciated! |
Awesome, fingers crossed
…On Wed, Jul 11, 2018 at 9:25 PM Martijn Dwars ***@***.***> wrote:
I've been your library for a few months now and it works brilliantly
(thanks)
Happy to hear! You're welcome.
However, we'd a network blip yesterday and it started causing
ExecutionExeptions in the HttpClient causing a thread leak. Having a look
at your code, it appears the client isn't releasing threads when exceptions
occur. I'm fairly sure this PR fixes the issue ..
I'll run some tests over the weekend and merge it if there are no
problems. Your contribution is much appreciated!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFBGPSGbhTSDunNU5Du8gL_jvAPi6k25ks5uFl8sgaJpZM4VLaac>
.
|
I suppose the big change that your PR introduces is that it re-uses a single HTTP client instead of creating one for each request. If you send many notifications in async, then creating a new HTTP client will waste a lot of resources. Is that correct? |
Not off the top of my head, I'll see if I can cobble together a unit test
to recreate it
…On Thu, Jul 12, 2018 at 7:49 PM Martijn Dwars ***@***.***> wrote:
Any suggestions on how to reproduce the issue? I tried calling the send()
method without internet connection which triggers an UnknownHostException
which in turn triggers a ExecutionException. However, the
UnknownHostException triggers a call to failed in the ClosableCallback
which calls close() on CloseableHttpAsyncClient. I don't see any threads
not being cleaned up if I call the send() method many times.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFBGPXv9ytXsNCPawgFDyZho5Jy3NjcKks5uF5o9gaJpZM4VLaac>
.
|
…troying on ConnectException to avoid thread leak
I've been your library for a few months now and it works brilliantly (thanks)
However, we'd a network blip yesterday and it started causing ExecutionExeptions in the HttpClient causing a thread leak. Having a look at your code, it appears the client isn't releasing threads when exceptions occur. I'm fairly sure this PR fixes the issue ..