[infinispan-issues] [JBoss JIRA] (ISPN-11942) JCache CacheEntryCreatedListener got TimeoutException ISPN000299 when listener calling code which accessing the created cache value

Sammy Chu (Jira) issues at jboss.org
Mon Aug 10 06:09:00 EDT 2020


    [ https://issues.redhat.com/browse/ISPN-11942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14375370#comment-14375370 ] 

Sammy Chu commented on ISPN-11942:
----------------------------------

Debugging found 2 issues:
# Before refactoring of ISPN-8651, the JCache#get() operation will NOT involve locking if no JCache expiry policy set. After refactoring, due to using ReadWriteMap, it will always do locking even no JCache expriy policy set, and always produce this issue.
# If JCache expiry policy is set, even before refactoring of ISPN-8651, this issue is reproducible.

This is strange that event listener should be run in the same thread, right? So theoretically even the cache entry is locked, the lock owner should be the same and should not have this issue happened, right?

> JCache CacheEntryCreatedListener got TimeoutException ISPN000299 when listener calling code which accessing the created cache value
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISPN-11942
>                 URL: https://issues.redhat.com/browse/ISPN-11942
>             Project: Infinispan
>          Issue Type: Bug
>          Components: API, Core, JCache
>    Affects Versions: 11.0.3.Final
>            Reporter: Sammy Chu
>            Priority: Major
>         Attachments: ISPN-11942-fail.log, ISPN-11942-success.log, ISPN-11942.zip
>
>
> We are running into issue when upgrading infinispan from 9.1.7.Final to 9.2.0.Final and got the TimeoutException: ISPN000299: Unable to acquire lock after X seconds for key Y...
> We reduced our settings and finally reproduce it in a simple setup:
> # configured a local cache (i.e. TestCache) with default settings
> # a simple service bean ServiceA with a dummy method foo() annotated with @CacheResult(cacheName = 'TestCache'), which just return string "THIS_IS_RESULT_OF_FOO"
> # a simple service bean ServiceB with a dummy method bar() which just return (ServiceA.foo() + "_PROCESSED_BY_BAR")
> # a JCache CacheEntryCreatedListener which calling ServiceB.bar() and register to TestCache
> When calling ServiceA.foo(), expecting ServiceA will generate a random string and got cached, then trigger the cache entry created listener to notify ServiceB to regenerate its value.
> We also tested on latest stable version (10.1.8.Final) and still have such issue. We checked versions one by one and confirmed this bug introduced between change of 9.1.7 and 9.2.0.
> [^ISPN-11942.zip] is a simple standalone application to reproduce this issue, change infinispan version from 10.1.8.Final to 9.1.7.Final will work correctly. Attached the trace log [^ISPN-11942-fail.log] when stay on 10.1.8.Final and [^ISPN-11942-success.log] when changed to 9.1.7.Final.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list