This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-6b6d1136-ab6a-4c6b-9b10-8c36f3c2bce0 XWIKI-23295 Open

TimeoutException when loading documents

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-24268975-f1e1-4a19-922c-f9bd6e77e003 Michael Hamann created this issue on 12/Jun/25 17:59
 
Summary: TimeoutException when loading documents
Issue Type: cid:jira-generated-image-avatar-6b6d1136-ab6a-4c6b-9b10-8c36f3c2bce0 Bug
Affects Versions: 16.10.0
Assignee: Unassigned
Components: Old Core
Created: 12/Jun/25 17:59
Priority: cid:jira-generated-image-static-major-80cf7774-e6c3-4239-9ad3-cf2a44c97b6b Major
Reporter: Michael Hamann
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).