Cache expiry is lost after an update #7236
We are using Hazelcast as a JCache provider. As JSR 107 Javadoc states, an update should not reset expiry time for CreatedExpiryPolicy. However, if we update a cache entry, it does not expire.
Here is a test case:
The entries expire as expected after 2 seconds, if we did not update them (via put or replace methods), so above test succeeds.
But if we update the entry (ie: uncomment out second put call) then the entry doesn't expire and test fails. Moreover, an update does not update expire time (ie: expiry time is not extended), but cache behaves as if expiry policy is eternal. That is, the following code block prints out "...still not expired" forever (using same config as above one, with CreatedExpiry policy with 2 second expiry time).
I tried this with hazelcast versions 3.4.6, 3.5.4, and 3.6-EA3.
I can confirm that only Apache Ignite runs as expected (an update does not change/reset expiry time for CreatedExpiryPolicy). Hazelcast and Infinispan fails as I summarized above.
Thanks for reporting the issue.
I have reproduced the issue with your test code and the problem is that expiry duration is set to
I will fix this issue before 3.6.