apache/hadoop · error · IllegalArgumentException

Decay Factor must be between 0 and 1

Error message

Decay Factor must be between 0 and 1

What it means

parseDecayFactor reads <ns>.decay-scheduler.decay-factor (falling back from the deprecated <ns>.faircallqueue.decay-scheduler.decay-factor, default 0.5). The factor controls how quickly accumulated call cost decays each sweep and is mathematically required to be strictly between 0 and 1; anything else (including exactly 0 or 1) throws IllegalArgumentException at scheduler construction, i.e., server startup.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java:352

    }

    return providers.get(0); // use the first
  }

  private static double parseDecayFactor(String ns, Configuration conf) {
    double factor = conf.getDouble(ns + "." +
        IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY, 0.0);
    if (factor == 0.0) {
      factor = conf.getDouble(ns + "." +
          IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_KEY,
          IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_DEFAULT);
    } else if ((factor > 0.0) && (factor < 1)) {
      LOG.warn(IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY +
          " is deprecated. Please use " +
          IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_KEY + ".");
    }
    if (factor <= 0 || factor >= 1) {
      throw new IllegalArgumentException("Decay Factor " +
        "must be between 0 and 1");
    }

    return factor;
  }

  private static long parseDecayPeriodMillis(String ns, Configuration conf) {
    long period = conf.getLong(ns + "." +
        IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY,
        0);
    if (period == 0) {
      period = conf.getLong(ns + "." +
          IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_KEY,
          IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_DEFAULT);
    } else if (period > 0) {
      LOG.warn((IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY +
          " is deprecated. Please use " +
          IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_KEY));

View on GitHub (pinned to 2add963021)

Solutions

  1. Set ipc.<port>.decay-scheduler.decay-factor to a fraction strictly between 0 and 1 (default 0.5; lower = longer memory, higher = faster forgetting).
  2. Remove the property to use the 0.5 default if you do not need decay tuning.
  3. If you wanted 'no decay', you cannot express it with this scheduler — keep a valid factor and lengthen period-ms instead.

Example fix

// before (core-site.xml)
<property><name>ipc.8020.decay-scheduler.decay-factor</name><value>1</value></property>
<!-- IllegalArgumentException: Decay Factor must be between 0 and 1 -->

// after
<property><name>ipc.8020.decay-scheduler.decay-factor</name><value>0.5</value></property>
Defensive patterns

Strategy: validation

Validate before calling

double f = conf.getDouble("ipc." + port + ".decay-scheduler.decay-factor", 0.5);
if (!(f > 0.0 && f < 1.0)) {
  throw new ConfigException("decay-scheduler.decay-factor must be in (0,1), got " + f);
}

Prevention

When it happens

Trigger: Setting decay-scheduler.decay-factor to 1, 0, a negative number, or a percentage like 50 in <ns> (namespace, typically ipc.<port>); setting the deprecated key to an invalid value (it is still validated after fallback); a typo making the property unparseable so it resolves as 0.

Common situations: Operators trying to 'disable decay' by setting the factor to 1 or 0; copying decay-factor examples that use percentages; tuning callqueue backoff without understanding the (0,1) open interval.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/3b6355c047c6d07e. Report an issue: GitHub.