You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/02 15:36:00 UTC

[jira] [Work logged] (BEAM-3119) direct-metrics-counter-committer threads are leaking

     [ https://issues.apache.org/jira/browse/BEAM-3119?focusedWorklogId=97545&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-97545 ]

ASF GitHub Bot logged work on BEAM-3119:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/May/18 15:35
            Start Date: 02/May/18 15:35
    Worklog Time Spent: 10m 
      Work Description: swegner commented on a change in pull request #4965: BEAM-3119 ensure the metrics thread pool is related to an execution
URL: https://github.com/apache/beam/pull/4965#discussion_r185540917
 
 

 ##########
 File path: runners/direct-java/src/test/java/org/apache/beam/runners/direct/ExecutorServiceParallelExecutorTest.java
 ##########
 @@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.direct;
+
+import static java.util.Collections.emptyMap;
+import static java.util.Collections.emptySet;
+
+import com.google.common.collect.LinkedListMultimap;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import org.apache.beam.sdk.options.PipelineOptionsFactory;
+import org.apache.beam.sdk.testing.ThreadLeakTracker;
+import org.joda.time.Instant;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.junit.rules.TestRule;
+
+/**
+ * Validates some basic behavior for the ExecutorServiceParallelExecutor.
+ */
+public class ExecutorServiceParallelExecutorTest {
+
+  @Rule
+  public final TestRule threadTracker = new ThreadLeakTracker();
+
+  @Rule
+  public final TestName testName = new TestName();
+
+  @Test
+  public void ensureMetricsThreadDoesntLeak() {
 
 Review comment:
   FYI, this test failed on an unrelated precommit: https://github.com/apache/beam/pull/5218 https://scans.gradle.com/s/rzxuq4ibgr32a/tests/jqhvlvf72f7pg-ipde5etqqejoa. Is the fix in https://github.com/apache/beam/pull/5096 ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 97545)
    Time Spent: 4h 40m  (was: 4.5h)

> direct-metrics-counter-committer threads are leaking
> ----------------------------------------------------
>
>                 Key: BEAM-3119
>                 URL: https://issues.apache.org/jira/browse/BEAM-3119
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-direct
>            Reporter: Etienne Chauchot
>            Assignee: Romain Manni-Bucau
>            Priority: Major
>             Fix For: 2.5.0
>
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> When I run ElasticsearchIOTests using ESv5, there is a thread leak control mechanism ({{com.carrotsearch.randomizedtesting.ThreadLeakControl}}). It waits for 5s for non-terminated threads at the end of a test. It detects leaked {{direct-metrics-counter-committer}} thread.
> {code}
> com.carrotsearch.randomizedtesting.ThreadLeakError: There are still zombie threads that couldn't be terminated:
>    1) Thread[id=296, name=direct-metrics-counter-committer, state=TIMED_WAITING, group=TGRP-ElasticsearchIOTest]
>         at sun.misc.Unsafe.park(Native Method)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>         at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
>         at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
>         at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
>         at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> 	at __randomizedtesting.SeedInfo.seed([59E504CA1B0DD6A8]:0){code}
> I tried to increase the timeout to 30s (by patching randomizedtesting-runner-2.5.0.jar) but still gets a zombie thread.
> To reproduce, just comment 
> {code}
> @ThreadLeakScope(ThreadLeakScope.Scope.NONE)
> {code}
>  in 
> {code}
> beam/sdks/java/io/elasticsearch-tests/elasticsearch-tests-5/src/test/java/org/apache/beam/sdk/io/elasticsearch/ElasticsearchIOTest.java
> {code}
> and run 
> {code}
> testRead()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)