You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@storm.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/27 03:09:00 UTC
[jira] [Updated] (STORM-2870) FileBasedEventLogger leaks non-daemon
ExecutorService which prevents process to be finished
[ https://issues.apache.org/jira/browse/STORM-2870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated STORM-2870:
----------------------------------
Labels: pull-request-available (was: )
> 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
>
> {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)