[
https://issues.apache.org/jira/browse/LENS-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15209763#comment-15209763
]
Amareshwari Sriramadasu commented on LENS-993:
----------------------------------------------
As per
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html
:
----
Any BlockingQueue may be used to transfer and hold submitted tasks. The use of
this queue interacts with pool sizing:
# If fewer than corePoolSize threads are running, the Executor always prefers
adding a new thread rather than queuing.
# If corePoolSize or more threads are running, the Executor always prefers
queuing a request rather than adding a new thread.
# If a request cannot be queued, a new thread is created unless this would
exceed maximumPoolSize, in which case, the task will be rejected.
----
With following code in QueryExecutionServiceImpl:
{code}
ThreadPoolExecutor estimatePool = new ThreadPoolExecutor(minPoolSize,
maxPoolSize, keepAlive, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(), threadFactory);
{code}
It would never create thread more than minPoolSize. Some discussion -
http://stackoverflow.com/questions/19528304/how-to-get-the-threadpoolexecutor-to-increase-threads-to-max-before-queueing
I'm proposing we use Executoes.newCachedThreadPool instead of creating
ThreadPoolExecutor by the server, as suggested in javadoc.
> Estimate thread pool does not grow beyond minimum pool size.
> ------------------------------------------------------------
>
> Key: LENS-993
> URL: https://issues.apache.org/jira/browse/LENS-993
> Project: Apache Lens
> Issue Type: Bug
> Components: server
> Reporter: Amareshwari Sriramadasu
> Assignee: Amareshwari Sriramadasu
> Fix For: 2.6
>
>
> We noticed that there are only 3 threads (the min pool size) on the server
> and not growing. And 3 threads are blocked on JDBC connection and all
> subsequent estimate calls timeout as there are no threads.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)