Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8178964

ConcurrentHashMap missed unlock and entered in deadlock

XMLWordPrintable

    • x86_64
    • linux

      FULL PRODUCT VERSION :
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      FULL OS VERSION :
      Linux sms-crm-app-03.gefest.local 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      our application stopped to process incomming requests.
      stack trace shows that tomact jdbc connection pool is locked on ReentrantLock. sun.misc.Unsafe.park(Native Method)
      and there is no any thread that holds the lock. ? missed unlock signal

      related bug seems closed long time ago, but the issue has appeared in our setup.
      http://stackoverflow.com/questions/3292577/is-it-possible-for-concurrenthashmap-to-deadlock
      http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6865591

      a thread dump sample see below. the lock 0x000000060087a750 is not hold by any threads.
      there are 595 of ~1000 threads that wait for the 0x000000060087a750 lock.

      "SimpleAsyncTaskExecutor-2441" #71598 prio=5 os_prio=0 tid=0x00000000024c1000 nid=0x992 waiting on condition [0x00007f7443d6f000]
         java.lang.Thread.State: WAITING (parking)
      at sun.misc.Unsafe.park(Native Method)
      - parking to wait for <0x000000060087a750> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
      at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209)
      at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285)
      at org.apache.tomcat.jdbc.pool.FairBlockingQueue.poll(FairBlockingQueue.java:264)
      at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
      at org.hibernate.loader.Loader.doQuery(Loader.java:801)
      ....

      Link on full thread stack dump:
      https://www.dropbox.com/sh/k1bj01adjuyxi22/AACmXxCqmaCOLY6iPmyJb9yXa?dl=0


      REPRODUCIBILITY :
      This bug can be reproduced rarely.

            fmatte Fairoz Matte
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: