Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-23295

TimeoutException when loading documents

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 16.10.0
    • Old Core
    • Unknown

    Description

      Whenever a document isn't found in the document cache, we store the result not only in the document cache but also in the page exists cache. As the page exists cache is usually much larger than the page cache, this may lead to a high write load on existing entries. It seems that Infinispan is very sensitive to high write load on keys which leads to errors like org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after 10 seconds for key … or even stuck threads at the very least when the cache is full. This can have stack traces like

         java.lang.Thread.State: TIMED_WAITING
              at jdk.internal.misc.Unsafe.park(Native Method)
              - waiting on java.util.concurrent.CompletableFuture$Signaller@43a8176a
              at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
              at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1866)
              at java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3465)
              at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3436)
              at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1939)
              at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
              at org.infinispan.commons.util.concurrent.CompletableFutures.await(CompletableFutures.java:130)
              at org.infinispan.interceptors.impl.SimpleAsyncInvocationStage.get(SimpleAsyncInvocationStage.java:36)
              at org.infinispan.interceptors.impl.AsyncInterceptorChainImpl.invoke(AsyncInterceptorChainImpl.java:249)
              at org.infinispan.cache.impl.InvocationHelper.doInvoke(InvocationHelper.java:323)
              at org.infinispan.cache.impl.InvocationHelper.invoke(InvocationHelper.java:111)
              at org.infinispan.cache.impl.InvocationHelper.invoke(InvocationHelper.java:93)
              at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1301)
              at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:1870)
              at org.infinispan.cache.impl.CacheImpl.put(CacheImpl.java:226)
              at org.infinispan.cache.impl.EncoderCache.put(EncoderCache.java:777)
              at org.xwiki.cache.infinispan.internal.InfinispanCache.set(InfinispanCache.java:94)
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:406)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2195)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2257)
              at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.getSecureDocument(DefaultAuthorExecutor.java:116)
              at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.before(DefaultAuthorExecutor.java:157)
              at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:97)
              at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
              at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
              at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.execute(DefaultBlockAsyncRendererExecutor.java:125)
              at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacro.execute(DefaultWikiMacro.java:129)
              at org.xwiki.rendering.wikimacro.internal.DefaultWikiMacro.execute(DefaultWikiMacro.java:61)
       

      Note that if you see such stack traces, you might also need to increase the size of the page exists cache to reduce the load on it. It makes sense to have a page exists cache that is close to the number of documents as the cache should be relatively small (it only stores a boolean with a document reference as key).

      Attachments

        Activity

          People

            Unassigned Unassigned
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: