{"record":{"id":"7386c4f3998563ce","repo":"apache/hadoop","slug":"invalid-value-configured-for-dfs-datanode-disk-che-7386c4","errorCode":null,"errorMessage":"Invalid value configured for dfs.datanode.disk.check.timeout - {} (should be >= 0)","messagePattern":"Invalid value configured for dfs\\.datanode\\.disk\\.check\\.timeout - (.+?) \\(should be >= 0\\)","errorType":"exception","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/DatasetVolumeChecker.java","lineNumber":152,"sourceCode":"\n    minDiskCheckGapMs = conf.getTimeDuration(\n        DFSConfigKeys.DFS_DATANODE_DISK_CHECK_MIN_GAP_KEY,\n        DFSConfigKeys.DFS_DATANODE_DISK_CHECK_MIN_GAP_DEFAULT,\n        TimeUnit.MILLISECONDS);\n\n    if (minDiskCheckGapMs < 0) {\n      throw new HadoopIllegalArgumentException(\"Invalid value configured for \"\n          + DFS_DATANODE_DISK_CHECK_MIN_GAP_KEY + \" - \"\n          + minDiskCheckGapMs + \" (should be >= 0)\");\n    }\n\n    diskCheckTimeout = conf.getTimeDuration(\n        DFSConfigKeys.DFS_DATANODE_DISK_CHECK_TIMEOUT_KEY,\n        DFSConfigKeys.DFS_DATANODE_DISK_CHECK_TIMEOUT_DEFAULT,\n        TimeUnit.MILLISECONDS);\n\n    if (diskCheckTimeout < 0) {\n      throw new HadoopIllegalArgumentException(\"Invalid value configured for \"\n          + DFS_DATANODE_DISK_CHECK_TIMEOUT_KEY + \" - \"\n          + diskCheckTimeout + \" (should be >= 0)\");\n    }\n\n    lastAllVolumesCheck = timer.monotonicNow() - minDiskCheckGapMs;\n\n    if (maxVolumeFailuresTolerated < DataNode.MAX_VOLUME_FAILURE_TOLERATED_LIMIT) {\n      throw new HadoopIllegalArgumentException(\"Invalid value configured for \"\n          + DFS_DATANODE_FAILED_VOLUMES_TOLERATED_KEY + \" - \"\n          + maxVolumeFailuresTolerated + \" \"\n          + DataNode.MAX_VOLUME_FAILURES_TOLERATED_MSG);\n    }\n\n    delegateChecker = new ThrottledAsyncChecker<>(\n        timer, minDiskCheckGapMs, diskCheckTimeout,\n        Executors.newCachedThreadPool(\n            new ThreadFactoryBuilder()\n                .setNameFormat(\"DataNode DiskChecker thread %d\")","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/DatasetVolumeChecker.java#L134-L170","documentation":"DatasetVolumeChecker reads dfs.datanode.disk.check.timeout a second time into diskCheckTimeout (used as the per-check timeout handed to ThrottledAsyncChecker) and validates it with >= 0. Because the earlier validation of the same key (line 123) already throws for values <= 0, this specific >= 0 branch is effectively dead code: any value that could trigger it (negative) would have aborted startup earlier with the 'should be > 0' message.","triggerScenarios":"Practically unreachable in a normal build: it would require dfs.datanode.disk.check.timeout to be negative while the identical earlier read was non-negative (e.g., a custom Configuration whose value changes between getTimeDuration calls, or a patched/branch-divergent DatasetVolumeChecker where the first check reads a different key).","commonSituations":"Custom Hadoop forks or patches where HDFS-14123-era refactoring changed one of the two reads to a different key, resurrecting this branch; static analysis or error-catalog tooling surfacing the message string. If you see this exact message, you are likely running modified code.","solutions":["If you maintain a fork, unify the duplicate reads of dfs.datanode.disk.check.timeout into one field with one validation (> 0)","If hit as a user: fix dfs.datanode.disk.check.timeout to a positive duration anyway - it satisfies both checks","Compare your deployed hadoop-hdfs jar against the upstream version to detect divergent/patched code"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"long t = conf.getTimeDuration(\n    DFSConfigKeys.DFS_DATANODE_DISK_CHECK_TIMEOUT_KEY,\n    DFSConfigKeys.DFS_DATANODE_DISK_CHECK_TIMEOUT_DEFAULT, TimeUnit.MILLISECONDS);\nif (t <= 0) throw new IllegalStateException(\n    \"dfs.datanode.disk.check.timeout must be > 0, got \" + t); // satisfies both validations","typeGuard":null,"tryCatchPattern":null,"preventionTips":["A single positive dfs.datanode.disk.check.timeout value satisfies every check in DatasetVolumeChecker","If maintaining a fork, keep only one validated read of the key to avoid divergent dead checks"],"tags":["hdfs","datanode","disk-check","config","startup","dead-code","validation"],"backgroundTag":"config-value-out-of-range","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}