Bucket.touch() integer limitation

The Bucket.touch() method allows the expiry parameter to be an integer which can be :

  • seconds or UNIX timestamp if number of second is less than 30 days;
  • UNIX timestamp if time is more than 30 days.

However if you’re passing the expiry parameter as a UNIX timestamp then you’re limited to Java’s max integer value which is : 2147483647 => Tue, 19 Jan 2038 03:14:07 GMT is the limit date for expiry. This can cause issues if you’re trying to set a longer TTL.

This sounds like a bug to me and the expiry parameter should be migrated to a long value (timestamps are by default longs in Java, see for example System.currentTimeMillis().

The issue is known and being tracked here.
@tyler.mitchell, our product manager is the best resource to discuss more on this.