jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-6622) Configure default core pool size for thread pool used by oak-lucene
Date Wed, 06 Sep 2017 10:26:00 GMT

    [ https://issues.apache.org/jira/browse/OAK-6622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16155153#comment-16155153
] 

Chetan Mehrotra commented on OAK-6622:
--------------------------------------

This default behaviour is bit counterintutive [1]. 

[1] https://stackoverflow.com/q/19528304

> Configure default core pool size for thread pool used by oak-lucene
> -------------------------------------------------------------------
>
>                 Key: OAK-6622
>                 URL: https://issues.apache.org/jira/browse/OAK-6622
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: lucene
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.8
>
>
> {{LuceneIndexProviderService}} currently configures a thread pool like below
> {code}
>  ThreadPoolExecutor executor = new ThreadPoolExecutor(
>           0,  //corePoolSize
>           5, //maxPoolSize
>          60L, 
>          TimeUnit.SECONDS,
>          new LinkedBlockingQueue<Runnable>(), //Unbounded queue
>          new ThreadFactory() {
> {code}
> Per [ThreadPoolExecutor|https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html]

> {quote}
> If there are more than corePoolSize but less than maximumPoolSize threads running, a
new thread will be created *only if the queue is full*
> {quote}
> Due to this currently the thread pool created by oak-lucene would only have 1 thread
to handle all task as the queue is unbounded one. And if for some reason this thread gets
stuck (due to some lock) then it would prevent other task in pool from further processing.
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message