You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by merlimat <gi...@git.apache.org> on 2017/05/11 17:27:01 UTC

[GitHub] bookkeeper pull request #152: BOOKKEEPER-1065: OrderedSafeExecutor should on...

GitHub user merlimat opened a pull request:

    https://github.com/apache/bookkeeper/pull/152

    BOOKKEEPER-1065: OrderedSafeExecutor should only have 1 thread per bucket

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/merlimat/bookkeeper bk-1065-ordering

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/bookkeeper/pull/152.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #152
    
----
commit 56935880f4c1e40c7f4cd666df4ba3bf027afdb7
Author: Matteo Merli <mm...@apache.org>
Date:   2017-05-11T17:06:55Z

    BOOKKEEPER-1065: OrderedSafeExecutor should only have 1 thread per bucket

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] bookkeeper pull request #152: BOOKKEEPER-1065: OrderedSafeExecutor should on...

Posted by merlimat <gi...@git.apache.org>.
Github user merlimat closed the pull request at:

    https://github.com/apache/bookkeeper/pull/152


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] bookkeeper issue #152: BOOKKEEPER-1065: OrderedSafeExecutor should only have...

Posted by merlimat <gi...@git.apache.org>.
Github user merlimat commented on the issue:

    https://github.com/apache/bookkeeper/pull/152
  
    Ok, this is the error that findbugs gives: 
    
    ```
    [INFO] --- findbugs-maven-plugin:3.0.4:check (default-cli) @ bookkeeper-server ---
    [INFO] BugInstance size is 1
    [INFO] Error size is 0
    [INFO] Total bugs: 1
    [INFO] Futile attempt to change max pool size of ScheduledThreadPoolExecutor in new org.apache.bookkeeper.util.OrderedSafeExecutor(String, int, ThreadFactory, StatsLogger, boolean, long) [org.apache.bookkeeper.util.OrderedSafeExecutor] At OrderedSafeExecutor.java:[line 186] DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR
    [INFO] 
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] bookkeeper issue #152: BOOKKEEPER-1065: OrderedSafeExecutor should only have...

Posted by merlimat <gi...@git.apache.org>.
Github user merlimat commented on the issue:

    https://github.com/apache/bookkeeper/pull/152
  
    I got a bit scared when I saw `ScheduledThreadPoolExecutor` is pass `MAX_INT` as the max thread pool size.. but I think the current code is correct. 
    
    I just did a quick verification and indeed it doesn't create more than one thread :
    
    ```java
    public static void main(String[] args) {
            ScheduledThreadPoolExecutor e = new ScheduledThreadPoolExecutor(1,
                    new ThreadFactoryBuilder().setNameFormat("test-%d").build());
    
            for (int i = 0; i < 10; i++) {
                final int n = i;
                e.submit(() -> {
                    System.out.println( Thread.currentThread().getName() + " |  Start task " + n);
                    try {
                        Thread.sleep(1000);
    
                        System.out.println( Thread.currentThread().getName() + " |  Done task " + n);
                    } catch (InterruptedException e1) {
                        e1.printStackTrace();
                    }
                });
            }
    
            e.shutdown();
        }
    ```
    
    Closing this PR as no fix is needed 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] bookkeeper issue #152: BOOKKEEPER-1065: OrderedSafeExecutor should only have...

Posted by eolivelli <gi...@git.apache.org>.
Github user eolivelli commented on the issue:

    https://github.com/apache/bookkeeper/pull/152
  
    Yes recently we removed a similar line due to findbugs warning


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---