[ 
https://issues.apache.org/jira/browse/STORM-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jungtaek Lim resolved STORM-2870.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.0.6
                   1.1.2
                   1.2.0
                   2.0.0

Merged into master, 1.x, 1.1.x, 1.0.x branches.

> FileBasedEventLogger leaks non-daemon ExecutorService which prevents process 
> to be finished
> -------------------------------------------------------------------------------------------
>
>                 Key: STORM-2870
>                 URL: https://issues.apache.org/jira/browse/STORM-2870
>             Project: Apache Storm
>          Issue Type: Bug
>          Components: storm-core
>    Affects Versions: 2.0.0, 1.2.0, 1.1.2, 1.0.6
>            Reporter: Jungtaek Lim
>            Assignee: Jungtaek Lim
>              Labels: pull-request-available
>             Fix For: 2.0.0, 1.2.0, 1.1.2, 1.0.6
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> {code}
>     private void setUpFlushTask() {
>         ScheduledExecutorService scheduler = 
> Executors.newSingleThreadScheduledExecutor();
>         Runnable task = new Runnable() {
>             @Override
>             public void run() {
>                 try {
>                     if(dirty) {
>                         eventLogWriter.flush();
>                         dirty = false;
>                     }
>                 } catch (IOException ex) {
>                     LOG.error("Error flushing " + eventLogPath, ex);
>                     throw new RuntimeException(ex);
>                 }
>             }
>         };
>         scheduler.scheduleAtFixedRate(task, FLUSH_INTERVAL_MILLIS, 
> FLUSH_INTERVAL_MILLIS, TimeUnit.MILLISECONDS);
> }
> {code}
> The code block initializes ExecutorService locally, which served threads are 
> not daemons so it can prevent JVM to be exit successfully.
> Moreover it should be considered as bad case: not labeling thread name. I 
> observed the process hung and got jstack, but hard to know where is the root, 
> because leaked thread has default thread name.



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

Reply via email to