{"record":{"id":"4684aeab76f805e8","repo":"apache/hadoop","slug":"invalid-value-for-mapreduce-task-spill-files-coun","errorCode":null,"errorMessage":"Invalid value for \"mapreduce.task.spill.files.count.limit\", current value: {spillFilesCountLimit}","messagePattern":"Invalid value for \"mapreduce\\.task\\.spill\\.files\\.count\\.limit\", current value: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java","lineNumber":998,"sourceCode":"      partitions = job.getNumReduceTasks();\n      rfs = ((LocalFileSystem)FileSystem.getLocal(job)).getRaw();\n\n      //sanity checks\n      final float spillper =\n        job.getFloat(JobContext.MAP_SORT_SPILL_PERCENT, (float)0.8);\n      final int sortmb = job.getInt(MRJobConfig.IO_SORT_MB,\n          MRJobConfig.DEFAULT_IO_SORT_MB);\n      indexCacheMemoryLimit = job.getInt(JobContext.INDEX_CACHE_MEMORY_LIMIT,\n                                         INDEX_CACHE_MEMORY_LIMIT_DEFAULT);\n      spillFilesCountLimit = job.getInt(JobContext.SPILL_FILES_COUNT_LIMIT,\n          SPILL_FILES_COUNT_LIMIT_DEFAULT);\n      if (spillper > (float)1.0 || spillper <= (float)0.0) {\n        throw new IOException(\"Invalid \\\"\" + JobContext.MAP_SORT_SPILL_PERCENT +\n            \"\\\": \" + spillper);\n      }\n      if(spillFilesCountLimit != SPILL_FILES_COUNT_UNBOUNDED_LIMIT_VALUE\n          && spillFilesCountLimit < 0) {\n        throw new IOException(\"Invalid value for \\\"\" + JobContext.SPILL_FILES_COUNT_LIMIT + \"\\\", \" +\n            \"current value: \" + spillFilesCountLimit);\n      }\n      if ((sortmb & 0x7FF) != sortmb) {\n        throw new IOException(\n            \"Invalid \\\"\" + JobContext.IO_SORT_MB + \"\\\": \" + sortmb);\n      }\n      sorter = ReflectionUtils.newInstance(job.getClass(\n                   MRJobConfig.MAP_SORT_CLASS, QuickSort.class,\n                   IndexedSorter.class), job);\n      // buffers and accounting\n      int maxMemUsage = sortmb << 20;\n      maxMemUsage -= maxMemUsage % METASIZE;\n      kvbuffer = new byte[maxMemUsage];\n      bufvoid = kvbuffer.length;\n      kvmeta = ByteBuffer.wrap(kvbuffer)\n         .order(ByteOrder.nativeOrder())\n         .asIntBuffer();\n      setEquator(0);","sourceCodeStart":980,"sourceCodeEnd":1016,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java#L980-L1016","documentation":"Error \"Invalid value for \"mapreduce.task.spill.files.count.limit\", current value: {spillFilesCountLimit}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java:998 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set mapreduce.task.spill.files.count.limit to a positive integer within the allowed range."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}