Bug 1218148

Summary: l1-lifespan attribute in distributed cache configuration does not enable l1 cache
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Dominik Pospisil <dpospisi>
Component: ClusteringAssignee: jboss-set
Status: CLOSED EOL QA Contact: Michal Vinkler <mvinkler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: mgencur, paul.ferraro, rhusar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-19 12:48:35 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:
Bug Depends On:    
Bug Blocks: 1015189    

Description Dominik Pospisil 2015-05-04 09:39:22 UTC
Description of problem:
l1-lifespan attribute in distributed cache configuration is not honored. If set to a non-zero value it just sets the underlying cache config parameter, but does not explicitly enable l1 which is by default disabled.

Comment 1 Dominik Pospisil 2015-05-04 12:42:58 UTC
DistributedCacheAdd does:

if (lifespan > 0) {
            builder.clustering().l1().lifespan(lifespan);
}

This seems to be correct as infinispan docs says:
public L1ConfigurationBuilder l1()
This method allows configuration of the L1 cache for distributed caches. When this method is called, it automatically enables L1.

However, contrary to this the l1() method just returns plain instance of L1ConfigurationBuilder created by empty constructor which default (disabled) value.

So it seems to be a bug in infinispan.

Comment 2 Martin Gencur 2015-05-05 08:57:08 UTC
The JavaDoc is still incorrect. The default value was changed as part of https://issues.jboss.org/browse/ISPN-1924 (from enabled to disabled by default). 
In order to enable L1 cache, one has to use l1().enable() and then set the lifespan to a desired value.

Comment 3 Martin Gencur 2015-05-05 09:00:16 UTC
For reference, this bug was also reported for JDG by https://issues.jboss.org/browse/ISPN-3867

Comment 4 Paul Ferraro 2015-05-05 11:49:10 UTC
This should be fixed to work the way it does upstream (in WF8/9)
e.g.
builder.clustering().l1().enabled(lifespan > 0).lifespan(lifespan)

Comment 6 Dominik Pospisil 2015-05-06 08:31:47 UTC
PR sent: https://github.com/jbossas/jboss-eap/pull/2420

Comment 7 Dominik Pospisil 2015-05-06 08:32:30 UTC
Proposing for 6.4.x as it blocks workaround for proposed BZ (1015189).

Comment 8 Mike McCune 2016-03-28 22:30:10 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions