yikf opened a new pull request #3042:
URL: https://github.com/apache/hadoop/pull/3042
### What changes were proposed in this pull request?
In `StatisticsDataReferenceCleaner`, Cleaner thread will be blocked if we
remove reference from ReferenceQueue unless the queue.enqueue` called but no
now.
As shown below, We call ReferenceQueue.remove() now while cleanUp, Call
chain as follow:
`StatisticsDataReferenceCleaner#queue.remove() -> ReferenceQueue.remove(0)
-> lock.wait(0)`
lock.wait(0) will waitting perpetual unless lock.notify/notifyAll be called,
But, lock.notifyAll is called when queue.enqueue only, so Cleaner thread will
be blocked.
**ThreadDump:**
```
"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)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]