{"record":{"id":"18c2aadd3501c15c","repo":"apache/hadoop","slug":"unable-to-recover-task-s","errorCode":null,"errorMessage":"Unable to recover task %s","messagePattern":"Unable to recover task (.+?)","errorType":"exception","errorClass":"PathCommitException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/commit/AbstractS3ACommitter.java","lineNumber":465,"sourceCode":"   * to be configured to support magic paths where the output isn't immediately\n   * visible. If the committer returns true, then committer setup will\n   * fail if the FS doesn't have the capability.\n   * Base implementation returns false.\n   * @return what the requirements of the committer are of the filesystem.\n   */\n  protected boolean requiresDelayedCommitOutputInFileSystem() {\n    return false;\n  }\n\n  /**\n   * Task recovery considered Unsupported: Warn and fail.\n   * @param taskContext Context of the task whose output is being recovered\n   * @throws IOException always.\n   */\n  @Override\n  public void recoverTask(TaskAttemptContext taskContext) throws IOException {\n    LOG.warn(\"Cannot recover task {}\", taskContext.getTaskAttemptID());\n    throw new PathCommitException(outputPath,\n        String.format(\"Unable to recover task %s\",\n            taskContext.getTaskAttemptID()));\n  }\n\n  /**\n   * if the job requires a success marker on a successful job,\n   * create the file {@link CommitConstants#_SUCCESS}.\n   *\n   * While the classic committers create a 0-byte file, the S3A committers\n   * PUT up a the contents of a {@link SuccessData} file.\n   * @param commitContext commit context\n   * @param pending the pending commits\n   *\n   * @return the success data, even if the marker wasn't created\n   *\n   * @throws IOException IO failure\n   */\n  protected SuccessData maybeCreateSuccessMarkerFromCommits(","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/commit/AbstractS3ACommitter.java#L447-L483","documentation":"OutputCommitter.recoverTask is invoked by the MapReduce application master during job recovery to reuse a previously committed task's output. S3A committers never support this: at recovery time the task's data is still pending multipart uploads, not committed files, so AbstractS3ACommitter.recoverTask logs a warning and always throws PathCommitException to fail the recovery attempt rather than produce wrong results.","triggerScenarios":"The MR AM restarts (failure or preemption), yarn.app.mapreduce.am.job.recovery.enable is true (default), and recovery replays a task attempt whose committer already wrote commit metadata, calling recoverTask on the S3A committer.","commonSituations":"Long Spark-on-YARN or MR jobs over S3A surviving an AM failover; clusters with aggressive AM restarts; jobs using staging or directory committers where task outputs live under _temporary until job commit.","solutions":["Rerun the job with AM recovery disabled for that job: set yarn.app.mapreduce.am.job.recovery.enable=false so tasks restart cleanly instead of recovering","Before the rerun, clean the output's _temporary (and staging) directories left by the failed attempt so stale pendingsets do not surface later","Reduce AM restart churn (memory/queue settings) if failovers are frequent"],"exampleFix":"# before\nspark-submit --conf spark.hadoop.yarn.app.mapreduce.am.job.recovery.enable=true ...\n\n# after\nspark-submit --conf spark.hadoop.yarn.app.mapreduce.am.job.recovery.enable=false \\\n  --conf spark.hadoop.mapreduce.fileoutputcommitter.marksuccessfuljobs=true ...","handlingStrategy":"fallback","validationCode":"// detect the recovery path before it hits the committer:\nif (jobContext.getConfiguration().getBoolean(\n        \"yarn.app.mapreduce.am.job.recovery.enable\", true)\n    && fsUri.getScheme().equals(\"s3a\")) {\n  job.getConfiguration().setBoolean(\"yarn.app.mapreduce.am.job.recovery.enable\", false);\n}","typeGuard":null,"tryCatchPattern":"try {\n  committer.recoverTask(taskContext);\n} catch (PathCommitException e) {\n  // recovery is fundamentally unsupported on S3A: restart the job cleanly\n  LOG.warn(\"S3A committer cannot recover tasks; rerunning job with recovery off\", e);\n  rerunJobWithRecoveryDisabled(outputPath);\n}","preventionTips":["Run S3A-committer jobs with yarn.app.mapreduce.am.job.recovery.enable=false","Clean _temporary and staging directories before any rerun","Do not design retry logic that assumes task-output recovery on S3A"],"tags":["aws","s3a","committer","mapreduce","job-recovery"],"backgroundTag":"task-recovery-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}