{"record":{"id":"40ca12c0f6984597","repo":"apache/hadoop","slug":"delay-is-negative-please-check","errorCode":null,"errorMessage":"delay={} is negative. Please check {}","messagePattern":"delay=(.+?) is negative\\. Please check (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java","lineNumber":280,"sourceCode":"    routerRenameCounter.decrementAndGet();\n  }\n\n  static void checkConfiguration(Configuration conf) throws IOException {\n    int map = conf.getInt(DFS_ROUTER_FEDERATION_RENAME_MAP, -1);\n    int bandwidth = conf.getInt(DFS_ROUTER_FEDERATION_RENAME_BANDWIDTH, -1);\n    long delay = conf.getLong(DFS_ROUTER_FEDERATION_RENAME_DELAY,\n        DFS_ROUTER_FEDERATION_RENAME_DELAY_DEFAULT);\n    int diff = conf.getInt(DFS_ROUTER_FEDERATION_RENAME_DIFF,\n        DFS_ROUTER_FEDERATION_RENAME_DIFF_DEFAULT);\n    if (map < 0) {\n      throw new IOException(\"map=\" + map + \" is negative. Please check \"\n          + DFS_ROUTER_FEDERATION_RENAME_MAP);\n    } else if (bandwidth < 0) {\n      throw new IOException(\n          \"bandwidth=\" + bandwidth + \" is negative. Please check \"\n              + DFS_ROUTER_FEDERATION_RENAME_BANDWIDTH);\n    } else if (delay < 0) {\n      throw new IOException(\"delay=\" + delay + \" is negative. Please check \"\n          + DFS_ROUTER_FEDERATION_RENAME_DELAY);\n    } else if (diff < 0) {\n      throw new IOException(\"diff=\" + diff + \" is negative. Please check \"\n          + DFS_ROUTER_FEDERATION_RENAME_DIFF);\n    }\n  }\n}\n","sourceCodeStart":262,"sourceCodeEnd":288,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java#L262-L288","documentation":"checkConfiguration reads the fed-rename trash delay from dfs.federation.router.federation.rename.delay; the default (1000, in ms) is positive, so this IOException only fires when an operator explicitly sets the key to a negative number. The delay controls how long rename waits for disallowed/open-file conditions before force handling in the distcp procedure.","triggerScenarios":"dfs.federation.router.federation.rename.delay is explicitly configured to a negative long on the router and a federation rename triggers checkConfiguration.","commonSituations":"Copy-pasted example configs with placeholder negative values; units confusion leading someone to write -1 meaning 'no delay'; global config templating that injects -1 defaults for optional numeric keys.","solutions":["Set dfs.federation.router.federation.rename.delay to a non-negative value (default 1000 ms) or remove the key to fall back to the default","Audit the router's hdfs-site.xml for other fed-rename keys set to -1 (map, bandwidth, diff) and fix them in the same pass","Restart the router after correcting the configuration"],"exampleFix":"# before\n<property><name>dfs.federation.router.federation.rename.delay</name><value>-1</value></property>\n# after\n<property><name>dfs.federation.router.federation.rename.delay</name><value>1000</value></property>  <!-- or omit the key entirely -->","handlingStrategy":"validation","validationCode":"long delay = conf.getLong(\"dfs.federation.router.federation.rename.delay\", 1000L);\nif (delay < 0) {\n  throw new IllegalStateException(\n      \"dfs.federation.router.federation.rename.delay must be non-negative (default 1000 ms)\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  routerFedRename.routerFedRename(src, dst, srcLocs, dstLocs);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"dfs.federation.router.federation.rename.delay\")) {\n    // remove the negative override or set it to the default, restart router\n  }\n  throw e;\n}","preventionTips":["Omit optional numeric keys rather than setting -1 placeholders","Validate all fed-rename keys (map/bandwidth/delay/diff) with one lint pass at deploy time","Beware config templating engines that inject negative defaults for optional settings"],"tags":["hdfs","router","federation","rename","configuration","delay"],"backgroundTag":"invalid-configuration-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}