@himanshug,

> from the design perspective, to guarantee safety, I think it would eventually 
> make more sense to make sure that all kinds of listeners are always executed 
> in something other than SameThreadExecutor or that listeners are never called 
> with internal locks being held as you don't know what listeners might end up 
> doing.

Probably the right thing to do is have the caller that sets a callback also 
pass an ExecutorService to use for that callback. That way the caller has some 
control over what thread pool to use, and the callee doesn't need to have its 
own callbacks thread pool that might never get used.

If it doesn't pass one in, _then_ use a same-thread executor.

[ Full content available at: 
https://github.com/apache/incubator-druid/pull/6212 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to