{"record":{"id":"7c98518e4b80654a","repo":"apache/hadoop","slug":"period-millis-must-be-0","errorCode":null,"errorMessage":"Period millis must be >= 0","messagePattern":"Period millis must be >= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java","lineNumber":373,"sourceCode":"\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));\n    }\n    if (period <= 0) {\n      throw new IllegalArgumentException(\"Period millis must be >= 0\");\n    }\n\n    return period;\n  }\n\n  private static double[] parseThresholds(String ns, Configuration conf,\n      int numLevels) {\n    int[] percentages = conf.getInts(ns + \".\" +\n        IPC_FCQ_DECAYSCHEDULER_THRESHOLDS_KEY);\n\n    if (percentages.length == 0) {\n      percentages = conf.getInts(ns + \".\" + IPC_DECAYSCHEDULER_THRESHOLDS_KEY);\n      if (percentages.length == 0) {\n        return getDefaultThresholds(numLevels);\n      }\n    } else {\n      LOG.warn(IPC_FCQ_DECAYSCHEDULER_THRESHOLDS_KEY +\n          \" is deprecated. Please use \" +","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java#L355-L391","documentation":"parseDecayPeriodMillis reads <ns>.decay-scheduler.period-ms (deprecated fallback <ns>.faircallqueue.decay-scheduler.period-ms, default 5000ms). Despite the message text saying '>= 0', the code rejects period <= 0, so the value must be strictly positive — it is the interval between decay sweeps. A zero or negative period would spin the sweep timer continuously, hence the guard at scheduler construction.","triggerScenarios":"Setting decay-scheduler.period-ms to 0 (a common 'disable' attempt) or a negative number under ipc.<port>; setting the deprecated faircallqueue key to 0; specifying a unit the parser reads as 0 (e.g., bare '0ms').","commonSituations":"Operators trying to disable the decay sweep by zeroing the period; tuning aggressive decay with tiny periods and fat-fingering to 0; copied configs from older Hadoop 2.x docs using the deprecated key.","solutions":["Set ipc.<port>.decay-scheduler.period-ms to a positive millisecond value (default 5000).","If you intended a very fast sweep, use a small positive value (e.g., 100) rather than 0.","Remove the property to accept the default."],"exampleFix":"// before (core-site.xml)\n<property><name>ipc.8020.decay-scheduler.period-ms</name><value>0</value></property>\n<!-- IllegalArgumentException: Period millis must be >= 0 -->\n\n// after\n<property><name>ipc.8020.decay-scheduler.period-ms</name><value>5000</value></property>","handlingStrategy":"validation","validationCode":"long p = conf.getTimeDuration(\"ipc.\" + port + \".decay-scheduler.period-ms\", 5000, TimeUnit.MILLISECONDS);\nif (p <= 0) {\n  throw new ConfigException(\"decay-scheduler.period-ms must be > 0, got \" + p);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Note the message text is misleading — the value must be strictly positive.","Prefer time-duration syntax ('5s') over bare numbers to avoid unit mistakes.","Never zero out period-ms to 'disable' the sweep; remove the property instead."],"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"}