-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
15.0.7.Final
-
None
The counter’s lifespan value is neither encoded nor decoded by the methods encodeConfiguration and decodeConfiguration in org.infinispan.counter.util.EncodeUtil. As a result, the created counter has a lifespan of 0 even though the CounterConfiguration is set to a non-zero value.
I used an existing StrongCounterHitsAwareTest test to demonstrate this behavior.
private void defineCounter(String counterName) { CounterManager counterManager = RemoteCounterManagerFactory.asCounterManager(client(0)); counterManager.defineCounter(counterName, CounterConfiguration.builder(CounterType.UNBOUNDED_STRONG).lifespan(100).build()); //the counter is lazily created and stored in the cache. The increment will make sure it is there! for (CounterManager cm : clientCounterManagers()) { final StrongCounter strongCounter = cm.getStrongCounter(counterName); assertEquals(100, strongCounter.getConfiguration().lifespan()); strongCounter.sync().incrementAndGet(); } }
The output is
java.lang.AssertionError: expected:<100> but was:<0>
Expected :100
Actual :0
- relates to
-
ISPN-12937 Expiring counters
- Closed