why LinkedBlockingQueue#poll(int, TimeUnit) is hanging up?

David Holmes david.holmes at oracle.com
Tue Sep 11 00:44:38 UTC 2012

This kind of issue is better discussed, at least initially on Doug Lea's 
concurrency interest list: concurrency-interest at cs.oswego.edu

The stack shows that it is the lock acquisition that is blocking 
indefinitely, not the poll itself. That is why it doesn't time out and 
why it hangs again immediately after you interrupt the thread.

You need to see what is happening to other threads using this LBQ and 
whether one of them holds the lock and is itself "stuck" somewhere. You 
also need to see if there are any asynchronous exceptions involved 
(Thread.stop use, or StackOverflowException) as these can corrupt the 
internal state of an AbstractQueuedSynchronizer like ReentrantLock.


On 11/09/2012 4:00 AM, Iris Clark wrote:
> Forwarding to core-libs-dev.
> iris
> -----Original Message-----
> From: Yegor Bugayenko [mailto:egor at technoparkcorp.com]
> Sent: Monday, September 10, 2012 5:52 AM
> To: jdk7-dev at openjdk.java.net
> Subject: why LinkedBlockingQueue#poll(int, TimeUnit) is hanging up?
> I already posted the question here:
> http://stackoverflow.com/questions/12349881
> Could one of you guys take a look? Thanks!
> -
> Yegor

More information about the core-libs-dev mailing list