[concurrency-interest] Deadlock with when no threads have the lock

Stephan Diestelhorst stephan.diestelhorst at gmail.com
Tue Jun 20 08:34:41 EDT 2017


(Transferring some knowledge from other domains)

I've seen a case where no one had the lock, yet the application was
deadlocking.  The thing that caused it then was a lost wakeup from the last
guy freeing the lock needing to prod the threads that wanted to enter the
lock, but stopped spinning on it (and went to sleep, got stashed away, get
marked as blocked).

Is there any chance the same thing could be happening here?

Stephan

On 20 June 2017 at 13:14, David M. Lloyd <david.lloyd at redhat.com> wrote:

> You say *all* threads, but it's not true: all threads are not waiting on
> the lock.
>
> Aside from that though, if threads are waiting, then a thread must own the
> lock, and furthermore it must be a thread that is not waiting on the lock
> (because they're reentrant and such an acquisition would have succeeded and
> would appear in the stack trace).  So, somehow the scala block may have
> failed in a way that prevented the finally block from running (stack
> overflow maybe, or maybe some Scala bug).
>
> It should be possible to reflectively invoke the "getOwner()" method of
> the ReentrantLock to see what thread had acquired the lock.
>
> On 06/20/2017 06:23 AM, Alex Otenko wrote:
>
>> https://github.com/mesosphere/marathon/blob/v1.4.2/src/main/
>> scala/mesosphere/marathon/util/Lock.scala#L29-L30 - your equals method
>> can deadlock.
>>
>> (not saying that this is the cause...)
>>
>> Alex
>>
>>
>> On 16 Jun 2017, at 22:36, Ken Sipe <kensipe at gmail.com <mailto:
>>> kensipe at gmail.com>> wrote:
>>>
>>> We have encountered a strange deadlock scenario in which it appears that
>>> all threads are waiting on acquiring a ReentrantLock, but no thread has the
>>> lock.
>>>
>>> Any thoughts on this?
>>>
>>> https://gist.github.com/timcharper/9ab4fea9da4669e620507e85e764d94a
>>>
>>>
>>> Thanks,
>>> ken
>>>
>>>
>>> _______________________________________________
>>> Concurrency-interest mailing list
>>> Concurrency-interest at cs.oswego.edu <mailto:Concurrency-interest at c
>>> s.oswego.edu>
>>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>>>
>>
>>
>>
>> _______________________________________________
>> Concurrency-interest mailing list
>> Concurrency-interest at cs.oswego.edu
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>>
>>
>
> --
> - DML
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20170620/a13e0fd2/attachment-0001.html>


More information about the Concurrency-interest mailing list