Use daemon thread pool for AsyncHttpClient in emitters#5057
Conversation
| @@ -63,6 +64,7 @@ public Emitter getEmitter( | |||
| if (sslContext != null) { | |||
There was a problem hiding this comment.
Could this common logic be shared between in HttpEmitterModule and ParametrizedUriEmitterModule?
There was a problem hiding this comment.
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.
it may be a static method in HttpEmitterModule, and ParametrizedUriEmitterModule uses it
There was a problem hiding this comment.
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.
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.
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.
* use daemon thread pool for AsyncHttpClient in emitters * changed to use existing helper methods * refactored creation of AsyncHttpClient
This PR is to configure
AsyncHttpClients to use daemon thread pool: #4973 (comment)