Open
Conversation
added 2 commits
July 11, 2018 16:41
…troying on ConnectException to avoid thread leak
Member
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! |
Author
|
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>
.
|
Member
|
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? |
Author
|
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>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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 ..