-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Use daemon thread pool for AsyncHttpClient in emitters #5057
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
Conversation
| ) | ||
| { | ||
| final DefaultAsyncHttpClientConfig.Builder builder = new DefaultAsyncHttpClientConfig.Builder(); | ||
| if (sslContext != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this common logic be shared between in HttpEmitterModule and ParametrizedUriEmitterModule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think so. But I am having a hard time to come up with a proper place to put the common code. Previously, part of the logic was in java-util's HttpClientInit.createClient; maybe we should have a similar factory method for AsyncHttpClient in java-util?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may be a static method in HttpEmitterModule, and ParametrizedUriEmitterModule uses it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I missed the other static method in HttpEmitterModule. Thanks 👍
|
👍 @xanec were you able to reproduce the issue and verified this fix ? |
|
also, does this need to be backported to 0.11.0 ? |
| if (sslContext != null) { | ||
| builder.setSslContext(new JdkSslContext(sslContext, true, ClientAuth.NONE)); | ||
| } | ||
| builder.setThreadFactory(new DefaultThreadFactory("emitter-http-client", true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
io.druid.java.util.common.concurrent.Execs#makeThreadFactory(java.lang.String)
| if (sslContext != null) { | ||
| builder.setSslContext(new JdkSslContext(sslContext, true, ClientAuth.NONE)); | ||
| } | ||
| builder.setThreadFactory(new DefaultThreadFactory("parametrized-emitter-http-client", true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
io.druid.java.util.common.concurrent.Execs#makeThreadFactory(java.lang.String) should be used
|
@himanshug yeah, I believe we are facing similar issue on our side. I'll need to get back to you on the verification. |
|
ok, i think we can merge it once the build passes as we definitely want that pool to be non-daemon in any case. |
|
This build fails with some strange error: Making an experiment with updating Hadoop 2.7.3 -> 2.7.4. |
|
@leventov seems like the weird error is due to this part: The Clearing the cache could help (https://docs.travis-ci.com/user/caching/). |
0d03c23 to
848663a
Compare
* use daemon thread pool for AsyncHttpClient in emitters * changed to use existing helper methods * refactored creation of AsyncHttpClient
) * Use daemon thread pool for AsyncHttpClient in emitters (#5057) * use daemon thread pool for AsyncHttpClient in emitters * changed to use existing helper methods * refactored creation of AsyncHttpClient * Avoid Execs, it's not available in this branch.
…ache#5069) * Use daemon thread pool for AsyncHttpClient in emitters (apache#5057) * use daemon thread pool for AsyncHttpClient in emitters * changed to use existing helper methods * refactored creation of AsyncHttpClient * Avoid Execs, it's not available in this branch.
This PR is to configure
AsyncHttpClients to use daemon thread pool: #4973 (comment)