{"record":{"id":"e463e16fa0935f4b","repo":"apache/hadoop","slug":"number-of-liststatus-threads-is-invalid-value","errorCode":null,"errorMessage":"Number of liststatus threads is invalid: {value}","messagePattern":"Number of liststatus threads is invalid: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java","lineNumber":179,"sourceCode":"    if (command.hasOption(DistCpOptionSwitch.BANDWIDTH.getSwitch())) {\n      try {\n        final Float mapBandwidth = Float.parseFloat(\n            getVal(command, DistCpOptionSwitch.BANDWIDTH.getSwitch()));\n        builder.withMapBandwidth(mapBandwidth);\n      } catch (NumberFormatException e) {\n        throw new IllegalArgumentException(\"Bandwidth specified is invalid: \" +\n            getVal(command, DistCpOptionSwitch.BANDWIDTH.getSwitch()), e);\n      }\n    }\n\n    if (command.hasOption(\n        DistCpOptionSwitch.NUM_LISTSTATUS_THREADS.getSwitch())) {\n      try {\n        final Integer numThreads = Integer.parseInt(getVal(command,\n            DistCpOptionSwitch.NUM_LISTSTATUS_THREADS.getSwitch()));\n        builder.withNumListstatusThreads(numThreads);\n      } catch (NumberFormatException e) {\n        throw new IllegalArgumentException(\n            \"Number of liststatus threads is invalid: \" + getVal(command,\n                DistCpOptionSwitch.NUM_LISTSTATUS_THREADS.getSwitch()), e);\n      }\n    }\n\n    if (command.hasOption(DistCpOptionSwitch.MAX_MAPS.getSwitch())) {\n      try {\n        final Integer maps = Integer.parseInt(\n            getVal(command, DistCpOptionSwitch.MAX_MAPS.getSwitch()));\n        builder.maxMaps(maps);\n      } catch (NumberFormatException e) {\n        throw new IllegalArgumentException(\"Number of maps is invalid: \" +\n            getVal(command, DistCpOptionSwitch.MAX_MAPS.getSwitch()), e);\n      }\n    }\n\n    if (command.hasOption(DistCpOptionSwitch.COPY_STRATEGY.getSwitch())) {\n      builder.withCopyStrategy(","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java#L161-L197","documentation":"The -numListstatusThreads option value must parse as a Java int (thread pool size for the listing phase's listStatus calls). Integer.parseInt failed and OptionsParser rethrows IllegalArgumentException with the offending value. Floats, words, and locale-formatted numbers are rejected.","triggerScenarios":"-numListstatusThreads 8.0, -numListstatusThreads four, or a comma-grouped value like 1,0 from a template.","commonSituations":"copy-pasted values with decimal points; scripts templating numbers with separators; operators confusing this listing-phase option with map count (-m).","solutions":["Pass a plain integer, e.g. -numListstatusThreads 10.","Remove decimal points and separators from the value.","Validate numeric options in the launching script before invoking distcp."],"exampleFix":"# before\nhadoop distcp -numListstatusThreads 8.0 hdfs://nn/src hdfs://nn/tgt\n\n# after\nhadoop distcp -numListstatusThreads 8 hdfs://nn/src hdfs://nn/tgt","handlingStrategy":"validation","validationCode":"// Wrapper validation: -numListstatusThreads must be a plain integer\nprivate static void checkInt(String flag, String v) {\n  if (!v.matches(\"[0-9]+\")) {\n    throw new IllegalArgumentException(flag + \" must be an integer, got: \" + v);\n  }\n}\ncheckInt(\"-numListstatusThreads\", args[i + 1]);","typeGuard":null,"tryCatchPattern":"try {\n  OptionsParser.parse(args);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Number of liststatus threads is invalid\")) {\n    throw new IllegalArgumentException(\"Fix -numListstatusThreads to a plain integer\", e);\n  }\n  throw e;\n}","preventionTips":["Pass plain integers - no decimals, no separators, no units.","Distinguish this listing-phase option from map count (-m) in runbooks.","Validate numeric args centrally in the launching script."],"tags":["distcp","cli","liststatus","number-format","invalid-arguments"],"backgroundTag":"invalid-numeric-option","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}