Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1158098

Summary: Cache CLI not returning null for expired entries
Product: [JBoss] JBoss Data Grid 6 Reporter: Shay Matasaro <smatasar>
Component: InfinispanAssignee: Tristan Tarrant <ttarrant>
Status: CLOSED UPSTREAM QA Contact: Martin Gencur <mgencur>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: afield, galder.zamarreno, jdg-bugs, jpallich
Target Milestone: ---   
Target Release: 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In Red Hat JBoss Data Grid, when <expiration lifespan="1000" max-idle="1000"/> is defined in server configuration and data is stored via CLI, the expiration settings are not applied. This is a known issue in JBoss Data Grid and the workaround is to set the expiration on per-invocation basis as follows: <screen>put b b1 expires 1s</screen>
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:43:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shay Matasaro 2014-10-28 14:58:27 UTC
Given the following cache configuration:

<distributed-cache name="shay" mode="SYNC" start="EAGER">
 <expiration lifespan="1000" max-idle="1000"/>
 </distributed-cache>

using the JDG cli :

[standalone@localhost:9999 cache-container=clustered] cache shay
[standalone@localhost:9999 distributed-cache=shay] put a a1
[standalone@localhost:9999 distributed-cache=shay] get a
a1
[standalone@localhost:9999 distributed-cache=shay] get a
a1

Even after lifespan is elapsed the cache still returns the value instead of null.

When setting the lifespan specifically on the entry , it does work
[standalone@localhost:9999 distributed-cache=shay] put b b1 expires 1s
[standalone@localhost:9999 distributed-cache=shay] get b
null

Comment 2 Alan Field 2014-10-28 15:03:12 UTC
From a discussion on IRC:

(10:59:26 AM) dberindei: shaym: the hotrod client used to have a problem with the default lifespan/maxIdle, it was overriding the defaults even if the user didn't use a method with a lifespan/maxIdle param
(10:59:36 AM) shaym: wfink,  dberindei   afield , this might be cli specific
(10:59:51 AM) shaym: dberindei, yes exactly what i was thinking
(10:59:55 AM) dberindei: shaym: the cli could have the same problem

Targeting JDG 6.4.0, so that this is triaged

Comment 3 Shay Matasaro 2014-10-29 19:23:27 UTC
customer indicated that he sees the same issue when using the java hotrod client

specifically infinispan-client-hotrod.jar version 6.1.1.Final-redhat-5

Which means that the problem might not be centred in the CLI.

I reviewed the CLI code yesterday and also didnt see anything obvious related to the put statement.

Comment 5 JBoss JIRA Server 2014-11-07 13:09:19 UTC
Galder ZamarreƱo <galder.zamarreno> updated the status of jira ISPN-4950 to Coding In Progress

Comment 6 Galder ZamarreƱo 2014-11-10 09:10:42 UTC
Shay, I replicated the CLI issue and sent a pull request to fix it: https://github.com/infinispan/infinispan/pull/3055

I was unable to replicate the issue for Hot Rod clients, and in fact we already had a test called ExpiryTest in Hot Rod client that verified that server side lifespan/maxIdle settings were applied properly.

I'd suggest you try the branch with both CLI and your Hot Rod client tests, and see if it works fine. If any is not working as expected, please share the code you use for the test. Thanks!

Comment 7 Red Hat Bugzilla 2025-02-10 03:43:24 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.