[
https://issues.apache.org/jira/browse/HADOOP-12706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15097317#comment-15097317
]
Sangjin Lee commented on HADOOP-12706:
--------------------------------------
I was unable to reproduce it on my mac OS + JDK 1.7, but was able to reproduce
it on ubuntu:
{noformat}
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
{noformat}
The frequency is about 1 out of 20 - 30 iterations. My strong suspicion is
whether System.gc() would force the phantom reference to be enqueued in a
timely manner. System.gc() itself is not deterministic (it's only a hint to the
JVM after all), and the manner in which the garbage collector determines
objects to be phantom-reachable seems to vary depending on the JVM/OS.
As [~cmccabe] and [~jlowe] observed, simply increasing the wait time in this
case doesn't seem to fix it.
I introduced a loop around GenericTestUtils.waitFor(), and if it times out I'm
now forcing another System.gc() call and trying again. I can verify that we do
hit that condition, and forcing another System.gc() call fixes it promptly. I
ran the modified code 100 times on the problem OS/JVM combination, and it now
passes all 100 times.
I'll post a patch shortly.
> TestLocalFsFCStatistics#testStatisticsThreadLocalDataCleanUp times out
> occasionally
> -----------------------------------------------------------------------------------
>
> Key: HADOOP-12706
> URL: https://issues.apache.org/jira/browse/HADOOP-12706
> Project: Hadoop Common
> Issue Type: Bug
> Components: test
> Reporter: Jason Lowe
> Assignee: Sangjin Lee
>
> TestLocalFsFCStatistics has been failing sometimes, and when it fails it
> appears to be from FCStatisticsBaseTest.testStatisticsThreadLocalDataCleanUp.
> The test is timing out when it fails.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)