apache/druid · error · IllegalStateException

Milliseconds is out of range of int

Error message

Milliseconds %d is out of range of int

What it means

RedisCacheConfig.DurationConfig.getMillisecondsAsInt found the configured duration exceeds Integer.MAX_VALUE milliseconds, so it cannot fit the int that Jedis configuration requires. This means an implausibly large expiry/TTL value was configured (over ~24.8 days in milliseconds).

Solutions

  1. Reduce the configured duration (e.g. druid.cache.expiration) to at most Integer.MAX_VALUE milliseconds.
  2. Express very long expirations in seconds via the corresponding seconds-based accessors if available.
  3. Add validation at config load time so out-of-range durations are rejected early with a clear message.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheConfig.java:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/348245390f553af0. Report an issue: GitHub.

Appendix: source

Thrown at extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheConfig.java:90

    /**
     * kept for test cases only
     */
    @VisibleForTesting
    DurationConfig(long milliseconds)
    {
      this.milliseconds = milliseconds;
    }

    public long getMilliseconds()
    {
      return milliseconds;
    }

    public int getMillisecondsAsInt()
    {
      if (milliseconds > Integer.MAX_VALUE) {
        throw new ISE("Milliseconds %d is out of range of int", milliseconds);
      }
      return (int) milliseconds;
    }

    public long getSeconds()
    {
      return milliseconds / 1000;
    }
  }

  /**
   * host of a standalone mode redis
   */
  @JsonProperty
  private String host;

  /**
   * port of a standalone mode redis

View on GitHub (pinned to 9b90983fd2)