{"record":{"id":"3b6355c047c6d07e","repo":"apache/hadoop","slug":"decay-factor-must-be-between-0-and-1","errorCode":null,"errorMessage":"Decay Factor must be between 0 and 1","messagePattern":"Decay Factor must be between 0 and 1","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java","lineNumber":352,"sourceCode":"    }\n\n    return providers.get(0); // use the first\n  }\n\n  private static double parseDecayFactor(String ns, Configuration conf) {\n    double factor = conf.getDouble(ns + \".\" +\n        IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY, 0.0);\n    if (factor == 0.0) {\n      factor = conf.getDouble(ns + \".\" +\n          IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_KEY,\n          IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_DEFAULT);\n    } else if ((factor > 0.0) && (factor < 1)) {\n      LOG.warn(IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY +\n          \" is deprecated. Please use \" +\n          IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_KEY + \".\");\n    }\n    if (factor <= 0 || factor >= 1) {\n      throw new IllegalArgumentException(\"Decay Factor \" +\n        \"must be between 0 and 1\");\n    }\n\n    return factor;\n  }\n\n  private static long parseDecayPeriodMillis(String ns, Configuration conf) {\n    long period = conf.getLong(ns + \".\" +\n        IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY,\n        0);\n    if (period == 0) {\n      period = conf.getLong(ns + \".\" +\n          IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_KEY,\n          IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_DEFAULT);\n    } else if (period > 0) {\n      LOG.warn((IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY +\n          \" is deprecated. Please use \" +\n          IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_KEY));","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java#L334-L370","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set ipc.<port>.decay-scheduler.decay-factor to a fraction strictly between 0 and 1 (default 0.5; lower = longer memory, higher = faster forgetting).","Remove the property to use the 0.5 default if you do not need decay tuning.","If you wanted 'no decay', you cannot express it with this scheduler — keep a valid factor and lengthen period-ms instead."],"exampleFix":"// before (core-site.xml)\n<property><name>ipc.8020.decay-scheduler.decay-factor</name><value>1</value></property>\n<!-- IllegalArgumentException: Decay Factor must be between 0 and 1 -->\n\n// after\n<property><name>ipc.8020.decay-scheduler.decay-factor</name><value>0.5</value></property>","handlingStrategy":"validation","validationCode":"double f = conf.getDouble(\"ipc.\" + port + \".decay-scheduler.decay-factor\", 0.5);\nif (!(f > 0.0 && f < 1.0)) {\n  throw new ConfigException(\"decay-scheduler.decay-factor must be in (0,1), got \" + f);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document decay-factor as an open interval (0,1); defaults are 0.5.","Add a config lint step for scheduler keys before server restart.","Remember both the deprecated faircallqueue.* key and the new key are validated — remove old keys."],"tags":["hadoop","ipc","decay-scheduler","config","validation","startup"],"backgroundTag":"config-validation-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}