You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Philipp Sushkin (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 07:58:59 UTC

[jira] [Created] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Uncontrolled number of threads in bookkeeper
--------------------------------------------

                 Key: BOOKKEEPER-173
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
             Project: Bookkeeper
          Issue Type: Bug
            Reporter: Philipp Sushkin


I am not sure if it is a but or not.

Say, I do have pc with 256 cores, and there is following code in bookkeeper:
{code:title=BookKeeper.java|borderStyle=solid}
OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
{code}
As I understand, callbackWorker is not used at all, so it could be removed.
Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).

Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.








--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258410#comment-13258410 ] 

Hudson commented on BOOKKEEPER-173:
-----------------------------------

Integrated in bookkeeper-trunk #470 (See [https://builds.apache.org/job/bookkeeper-trunk/470/])
    BOOKKEEPER-173: Uncontrolled number of threads in bookkeeper (sijie via fpj) (Revision 1328452)

     Result = SUCCESS
fpj : 
Files : 
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ClientConfiguration.java
* /zookeeper/bookkeeper/trunk/doc/bookieConfigParams.textile
* /zookeeper/bookkeeper/trunk/doc/bookkeeperConfig.textile
* /zookeeper/bookkeeper/trunk/doc/bookkeeperConfigParams.textile
* /zookeeper/bookkeeper/trunk/doc/index.textile

                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>            Assignee: Sijie Guo
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch, BK-173.patch_v2, BOOKKEEPER-173.v3.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Flavio Junqueira (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212067#comment-13212067 ] 

Flavio Junqueira commented on BOOKKEEPER-173:
---------------------------------------------

I agree, callbackWorker is not used any longer and we may want to have a constructor that allows the application to pass a different OrderedSafeExecutor.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Sijie Guo (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-173:
---------------------------------

    Attachment: BK-173.patch_v2

attach a new patch to add more documents to address Flavio's comments.

beside that, I also put other existing client configuration settings in doc/bookkeeperConfigParam.textile.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>            Assignee: Sijie Guo
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch, BK-173.patch_v2
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Flavio Junqueira (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258385#comment-13258385 ] 

Flavio Junqueira commented on BOOKKEEPER-173:
---------------------------------------------

+1 as well. Thanks, Sijie.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>            Assignee: Sijie Guo
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch, BK-173.patch_v2, BOOKKEEPER-173.v3.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Flavio Junqueira (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flavio Junqueira updated BOOKKEEPER-173:
----------------------------------------

    Attachment: BOOKKEEPER-173.v3.patch

It looks good, Sijie. I just made some minor corrections, please check.

Also, I was wondering if we have a patch for the password issue with bookie recovery that is described in the documentation. If we don't have a jira, it would be great if we could open one before resolving this issue.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>            Assignee: Sijie Guo
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch, BK-173.patch_v2, BOOKKEEPER-173.v3.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Ivan Kelly (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214517#comment-13214517 ] 

Ivan Kelly commented on BOOKKEEPER-173:
---------------------------------------

This should be simple to fix using by adding an config option to ServerConfiguration. The default can be Runetime.getRuntime().availableProcessors() which seems fine on commodity hardware, and then for highend stuff, the admin could configure fewer threads. Philipp, could you have a go at generating a patch that does this?
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Sijie Guo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258246#comment-13258246 ] 

Sijie Guo commented on BOOKKEEPER-173:
--------------------------------------

thanks Flavio for those corrections. it is good to me. +1.

> Also, I was wondering if we have a patch for the password issue with bookie recovery that is described in the documentation. If we don't have a jira, it would be great if we could open one before resolving this issue.

hmm, currently we don't have a jira to track that issue. I will create one.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>            Assignee: Sijie Guo
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch, BK-173.patch_v2, BOOKKEEPER-173.v3.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Sijie Guo (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-173:
---------------------------------

    Attachment: BK-173.patch

attach a patch to expose number of worker threads as a configuration setting. as I need to use this setting when adding test case for BOOKKEEPER-215.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Sijie Guo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254717#comment-13254717 ] 

Sijie Guo commented on BOOKKEEPER-173:
--------------------------------------

actually in BOOKKEEPER-215, the patch used the callbackWorker. LedgerRecoveryOp call back to bookkeeper in bookkeeper's callback, so it would introduce deadlock with limit permits. so I use this callbackWorker to execute forward read in LedgerRecovery procedure to avoid deadlock.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Ivan Kelly (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254692#comment-13254692 ] 

Ivan Kelly commented on BOOKKEEPER-173:
---------------------------------------

callbackWorker is never used and should be removed. Otherwise the patch is good.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Sijie Guo (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13257115#comment-13257115 ] 

Sijie Guo commented on BOOKKEEPER-173:
--------------------------------------

@Flavio, 

> If setNumWorkerThreads is called after the BookKeeper object is constructed, then it has no effect on the number of threads in the pool.

yes, ur right. How about clarifying it in the documentation of this method?

> Also, it would be good to add a description of these options to the documentation.

will do it in the new patch.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>            Assignee: Sijie Guo
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Flavio Junqueira (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256626#comment-13256626 ] 

Flavio Junqueira commented on BOOKKEEPER-173:
---------------------------------------------

I have one quick clarification and one request. If setNumWorkerThreads is called after the BookKeeper object is constructed, then it has no effect on the number of threads in the pool. Should we enforce somehow that the value doesn't change after the BookKeeper object is constructed? Otherwise the semantics could be confusing.

Also, it would be good to add a description of these options to the documentation.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>             Fix For: 4.1.0
>
>         Attachments: BK-173.patch
>
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-173) Uncontrolled number of threads in bookkeeper

Posted by "Flavio Junqueira (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214520#comment-13214520 ] 

Flavio Junqueira commented on BOOKKEEPER-173:
---------------------------------------------

+1 on the idea of having a configuration option.
                
> Uncontrolled number of threads in bookkeeper
> --------------------------------------------
>
>                 Key: BOOKKEEPER-173
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-173
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Philipp Sushkin
>
> I am not sure if it is a but or not.
> Say, I do have pc with 256 cores, and there is following code in bookkeeper:
> {code:title=BookKeeper.java|borderStyle=solid}
> OrderedSafeExecutor callbackWorker = new OrderedSafeExecutor(Runtime.getRuntime().availableProcessors());
> OrderedSafeExecutor mainWorkerPool = new OrderedSafeExecutor(Runtime .getRuntime().availableProcessors());
> {code}
> As I understand, callbackWorker is not used at all, so it could be removed.
> Also could be required to get more control over mainWorkerPool (say, extract interface + pass instance through contructor).
> Myabe there are other places in library where some thread pools are created without ability to reuse existing thread pools in application.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira