Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-2345

Many threads are blocked trying to lock the persistence manager

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.5
    • Fix Version/s: None
    • Component/s: jackrabbit-core, JCR 1.0.1
    • Labels:
      None
    • Environment:
      HP Unix

      Description

      We implemented a multi-threaded export functionlity for our JR repository, but it turns out that intended parallel behavior can't be achieved becuase most of the threads seemed to be waiting for OraclePersistenceManager.

      This is the stack trace for most of the waiting threads:

      – Blocked trying to get lock: org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager@0x2b71b2c979c0[fat lock]
      at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
      at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1675)[optimized]
      at jrockit/vm/Locks.lockFat(Locks.java:1776)[optimized]
      at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1312)[optimized]
      at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1259)[optimized]
      at org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.exists(AbstractBundlePersistenceManager.java:506)[optimized]
      at org/apache/jackrabbit/core/state/SharedItemStateManager.hasNonVirtualItemState(SharedItemStateManager.java:1343)[inlined]
      at org/apache/jackrabbit/core/state/SharedItemStateManager.hasItemState(SharedItemStateManager.java:297)[optimized]
      at org/apache/jackrabbit/core/state/XAItemStateManager.hasItemState(XAItemStateManager.java:295)[optimized]
      at org/apache/jackrabbit/core/state/SessionItemStateManager.getItemState(SessionItemStateManager.java:181)[optimized]
      at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:282)[inlined]
      at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:249)[inlined]
      at org/apache/jackrabbit/core/ItemManager.getNode(ItemManager.java:513)[inlined]
      at org/apache/jackrabbit/core/LazyItemIterator.prefetchNext(LazyItemIterator.java:109)[inlined]
      at org/apache/jackrabbit/core/LazyItemIterator.next(LazyItemIterator.java:230)[inlined]
      at org/apache/jackrabbit/core/LazyItemIterator.nextNode(LazyItemIterator.java:137)[optimized]
      ^-- Holding lock: org/apache/jackrabbit/core/ItemManager@0x2b71ec068f58[thin lock]
      at org/apache/jackrabbit/commons/xml/Exporter.exportNodes(Exporter.java:212)[optimized]
      at org/apache/jackrabbit/commons/xml/DocumentViewExporter.exportNode(DocumentViewExporter.java:77)[inlined]
      at org/apache/jackrabbit/commons/xml/Exporter.exportNode(Exporter.java:294)[inlined]
      at org/apache/jackrabbit/commons/xml/Exporter.export(Exporter.java:143)[optimized]
      at org/apache/jackrabbit/commons/AbstractSession.export(AbstractSession.java:462)[inlined]
      at org/apache/jackrabbit/commons/AbstractSession.exportDocumentView(AbstractSession.java:236)[inlined]
      at org/apache/jackrabbit/commons/AbstractSession.exportDocumentView(AbstractSession.java:281)[optimized]
      ^-- Holding lock: org/apache/jackrabbit/core/XASessionImpl@0x2b71ec068950[thin lock]

      This is the stack trace for blocking thread:

      at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
      at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:46)[optimized]
      at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)[inlined]
      at java/net/SocketInputStream.read(SocketInputStream.java:129)[optimized]
      at oracle/net/ns/Packet.receive()V(Unknown Source)[inlined]
      at oracle/net/ns/DataPacket.receive()V(Unknown Source)[optimized]
      at oracle/net/ns/NetInputStream.getNextPacket()V(Unknown Source)[optimized]
      at oracle/net/ns/NetInputStream.read([BII)I(Unknown Source)[inlined]
      at oracle/net/ns/NetInputStream.read([B)I(Unknown Source)[inlined]
      at oracle/net/ns/NetInputStream.read()I(Unknown Source)[optimized]
      at oracle/jdbc/driver/T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1104)[inlined]
      at oracle/jdbc/driver/T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075)[inlined]
      at oracle/jdbc/driver/T4C8TTILob.receiveReply(T4C8TTILob.java:872)[optimized]
      at oracle/jdbc/driver/T4C8TTILob.getChunkSize(T4C8TTILob.java:329)[inlined]
      at oracle/jdbc/driver/T4CConnection.getChunkSize(T4CConnection.java:2026)[optimized]
      ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x2b71b2ce0650[thin lock]
      at oracle/sql/BLOB.getChunkSize(BLOB.java:389)[inlined]
      at oracle/sql/BLOB.getBufferSize(BLOB.java:410)[inlined]
      at oracle/sql/BLOB.getBinaryStream(BLOB.java:229)[optimized]
      at org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.getBytes(BundleDbPersistenceManager.java:1110)[inlined]
      at org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.loadBundle(BundleDbPersistenceManager.java:1142)[inlined]
      at org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.loadBundle(BundleDbPersistenceManager.java:1094)[inlined]
      at org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.getBundle(AbstractBundlePersistenceManager.java:701)[inlined]
      at org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.exists(AbstractBundlePersistenceManager.java:506)[optimized]
      ^-- Holding lock: org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager@0x2b71b2c979c0[fat lock]
      at org/apache/jackrabbit/core/state/SharedItemStateManager.hasNonVirtualItemState(SharedItemStateManager.java:1343)[inlined]
      at org/apache/jackrabbit/core/state/SharedItemStateManager.hasItemState(SharedItemStateManager.java:297)[optimized]
      at org/apache/jackrabbit/core/state/XAItemStateManager.hasItemState(XAItemStateManager.java:295)[optimized]
      at org/apache/jackrabbit/core/state/SessionItemStateManager.getItemState(SessionItemStateManager.java:181)[optimized]
      at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:282)[inlined]
      at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:249)[inlined]
      at org/apache/jackrabbit/core/ItemManager.getNode(ItemManager.java:513)[inlined]
      at org/apache/jackrabbit/core/LazyItemIterator.prefetchNext(LazyItemIterator.java:109)[inlined]
      at org/apache/jackrabbit/core/LazyItemIterator.next(LazyItemIterator.java:230)[inlined]
      at org/apache/jackrabbit/core/LazyItemIterator.nextNode(LazyItemIterator.java:137)[optimized]
      ^-- Holding lock: org/apache/jackrabbit/core/ItemManager@0x2b71dcf8c668[thin lock]
      at org/apache/jackrabbit/commons/xml/Exporter.exportNodes(Exporter.java:212)[optimized]
      at org/apache/jackrabbit/commons/xml/DocumentViewExporter.exportNode(DocumentViewExporter.java:77)[inlined]
      at org/apache/jackrabbit/commons/xml/Exporter.exportNode(Exporter.java:294)[inlined]
      at org/apache/jackrabbit/commons/xml/Exporter.export(Exporter.java:143)[optimized]
      at org/apache/jackrabbit/commons/AbstractSession.export(AbstractSession.java:462)[inlined]
      at org/apache/jackrabbit/commons/AbstractSession.exportDocumentView(AbstractSession.java:236)[inlined]
      at org/apache/jackrabbit/commons/AbstractSession.exportDocumentView(AbstractSession.java:281)[optimized]
      ^-- Holding lock: org/apache/jackrabbit/core/XASessionImpl@0x2b71dcf8c3c0[thin lock]

      Oracle database performfs as usual. So, I doubt that it is an Oracle problem. In any case is there any way to avoid other threads blocking each other while performing read operations from PM?

      1. OraclePoolingPersistenceManager.java
        12 kB
        Andrey Adamovich
      2. dump3.txt
        133 kB
        Andrey Adamovich
      3. dump2.txt
        129 kB
        Andrey Adamovich
      4. dump1.txt
        129 kB
        Andrey Adamovich

        Issue Links

          Activity

          Andrey Adamovich created issue -
          Andrey Adamovich made changes -
          Field Original Value New Value
          Attachment dump1.txt [ 12421224 ]
          Attachment dump2.txt [ 12421225 ]
          Attachment dump3.txt [ 12421226 ]
          Andrey Adamovich made changes -
          Component/s locks [ 11615 ]
          Andrey Adamovich made changes -
          Attachment OraclePoolingPersistenceManager.java [ 12422093 ]
          Jukka Zitting made changes -
          Summary Many threads are blocked trying to get lock: org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager@0x2b71b2c979c0[fat lock] Many threads are blocked trying to lock the persistence manager
          Hugo Lassiège made changes -
          Link This issue relates to JCR-2679 [ JCR-2679 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Andrey Adamovich
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development