You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "JiangHua Zhu (Jira)" <ji...@apache.org> on 2021/09/17 12:03:00 UTC

[jira] [Commented] (HADOOP-17728) Fix issue of the StatisticsDataReferenceCleaner cleanUp

    [ https://issues.apache.org/jira/browse/HADOOP-17728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17416637#comment-17416637 ] 

JiangHua Zhu commented on HADOOP-17728:
---------------------------------------

We encountered similar problems, such as:
"org.apache.hadoop.fs.FileSystem$Statistics$StatisticsDataReferenceCleaner" #29 daemon prio=5 os_prio=0 tid=0x00007fe1d55db000 nid=0x3f96 in Object.wait() [0x00007fe1a3cb6000]
    java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
-waiting on <0x000000072661f828> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
-locked <0x000000072661f828> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at org.apache.hadoop.fs.FileSystem$Statistics$StatisticsDataReferenceCleaner.run(FileSystem.java:3701)
at java.lang.Thread.run(Thread.java:748)
I think this problem may not happen by accident.

> Fix issue of the StatisticsDataReferenceCleaner cleanUp
> -------------------------------------------------------
>
>                 Key: HADOOP-17728
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17728
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 3.2.1
>            Reporter: yikf
>            Assignee: yikf
>            Priority: Minor
>              Labels: pull-request-available, reverted
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> Cleaner thread will be blocked if we remove reference from ReferenceQueue unless the `queue.enqueue` called.
> ----
>     As shown below, We call ReferenceQueue.remove() now while cleanUp, Call chain as follow:
>                          *StatisticsDataReferenceCleaner#queue.remove()  ->  ReferenceQueue.remove(0)  -> lock.wait(0)*
>     But, lock.notifyAll is called when queue.enqueue only, so Cleaner thread will be blocked.
>  
> ThreadDump:
> {code:java}
> "Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f7afc088800 nid=0x2119 in Object.wait() [0x00007f7b00230000]
>    java.lang.Thread.State: WAITING (on object monitor)
>         at java.lang.Object.wait(Native Method)
>         - waiting on <0x00000000c00c2f58> (a java.lang.ref.Reference$Lock)
>         at java.lang.Object.wait(Object.java:502)
>         at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
>         - locked <0x00000000c00c2f58> (a java.lang.ref.Reference$Lock)
>         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org