Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-2612

unclear lifespan expiration lifespan value (seconds or UnixTime) for expiration for remote access with HotRod




      The documentation of the org.infinispan.client.hotrod.RemoteCache API is confusing. The Class header explain that lifespan expiration will use Seconds or UnitTime depend on the given value but the methods with lifespan will not reflect that with a hint.

      Any versions of the API document (Upstream 9.4 / JDG 7.3 / JDG 7.2 / JDG 6.5 / JDG 6.4) contains the same explanation like the following:

      Eviction and expiration: Unlike local Cache cache, which allows specifying time values with any granularity (as defined by TimeUnit), HotRod only supports seconds as time units. If a different time unit is used instead, HotRod will transparently convert it to seconds, using TimeUnit.toSeconds(long) method. This might result in loss of precision for values specified as nanos or milliseconds.
      Another fundamental difference is in the case of lifespan (naturally does NOT apply for max idle): If number of seconds is bigger than 30 days, this number of seconds is treated as UNIX time and so, represents the number of seconds since 1/1/1970.

      But the behavior is different for different DG releases. When the specified lifespan value is bigger than 30 days:

      • JDG 6.4: the value is treated as UNIX time expiry
      • JDG 6.5/6.6/7.0: the specified value (the maximum is Integer.MAX_VALUE) is treated as lifespan for Hot Rod protocol 2.2 or later. However, it is treated as UNIX time expiry for Hot Rod protocol 2.1 or before.
      • JDG 7.1/7.2/7.3: the value is treated as UNIX time expiry regardless of Hot Rod protocol version

      There should be a clear behavior which need to be documented in the API and JavaDoc


        Issue Links



              ttarrant@redhat.com Tristan Tarrant
              rhn-support-wfink Wolf-Dieter Fink
              0 Vote for this issue
              4 Start watching this issue