Merge pull request #8756 from janvojt/fix/jetty-10-npe-with-destination-idle-timeout
Issue #8753 - Fix HttpClient initialization with destinationIdleTimeout set.
This commit is contained in:
commit
a6afbaf470
|
@ -195,7 +195,8 @@ public class HttpClient extends ContainerLifeCycle
|
|||
{
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool();
|
||||
threadPool.setName(name);
|
||||
setExecutor(threadPool);
|
||||
executor = threadPool;
|
||||
setExecutor(executor);
|
||||
}
|
||||
int maxBucketSize = executor instanceof ThreadPool.SizedThreadPool
|
||||
? ((ThreadPool.SizedThreadPool)executor).getMaxThreads() / 2
|
||||
|
@ -207,10 +208,13 @@ public class HttpClient extends ContainerLifeCycle
|
|||
addBean(new ArrayRetainableByteBufferPool(0, 2048, 65536, maxBucketSize));
|
||||
Scheduler scheduler = getScheduler();
|
||||
if (scheduler == null)
|
||||
setScheduler(new ScheduledExecutorScheduler(name + "-scheduler", false));
|
||||
{
|
||||
scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false);
|
||||
setScheduler(scheduler);
|
||||
}
|
||||
|
||||
if (resolver == null)
|
||||
setSocketAddressResolver(new SocketAddressResolver.Async(getExecutor(), getScheduler(), getAddressResolutionTimeout()));
|
||||
setSocketAddressResolver(new SocketAddressResolver.Async(getExecutor(), scheduler, getAddressResolutionTimeout()));
|
||||
|
||||
handlers.put(new ContinueProtocolHandler());
|
||||
handlers.put(new RedirectProtocolHandler(this));
|
||||
|
|
Loading…
Reference in New Issue