{"record":{"id":"34c0f97dbccaa114","repo":"apache/hadoop","slug":"parallel-access-to-the-create-path-detected-faili-34c0f9","errorCode":null,"errorMessage":"Parallel access to the create path detected. Failing request due to precondition failure","messagePattern":"Parallel access to the create path detected\\. Failing request due to precondition failure","errorType":"exception","errorClass":"ConcurrentWriteOperationDetectedException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java","lineNumber":688,"sourceCode":"        if (isExplicitDir) {\n          throw new AbfsRestOperationException(HTTP_CONFLICT,\n              AzureServiceErrorCode.PATH_CONFLICT.getErrorCode(),\n              PATH_EXISTS,\n              null);\n        }\n\n        String eTag = extractEtagHeader(op.getResult());\n\n        try {\n          // overwrite only if eTag matches with the file properties fetched before\n          op = createPathRestOp(relativePath, true, true,\n              isAppendBlob, eTag, contextEncryptionAdapter, tracingContext);\n        } catch (AbfsRestOperationException ex) {\n          if (ex.getStatusCode() == HTTP_PRECON_FAILED) {\n            // Is a parallel access case, as file with eTag was just queried\n            // and precondition failure can happen only when another file with\n            // different etag got created.\n            throw new ConcurrentWriteOperationDetectedException(\"Parallel access to the create path detected. Failing request \"\n                + \"due to precondition failure\");\n          } else {\n            throw ex;\n          }\n        }\n      } else {\n        throw e;\n      }\n    }\n    return op;\n  }\n\n  /**\n   * Get Rest Operation for API\n   * <a href=\"../../../../site/markdown/blobEndpoint.md#lease-blob\">Lease Blob</a>.\n   * @param path on which lease has to be acquired.\n   * @param duration for which lease has to be acquired.\n   * @param tracingContext for tracing the service call.","sourceCodeStart":670,"sourceCodeEnd":706,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java#L670-L706","documentation":"Second race detector in conditionalCreateOverwriteFile: after reading the eTag, the client re-issues the create conditioned on If-Match <eTag>. HTTP 412 Precondition Failed means the object changed between the status call and the create (a different eTag now), so the write is aborted with ConcurrentWriteOperationDetectedException to preserve single-writer semantics instead of overwriting a stranger's data.","triggerScenarios":"Non-HNS account: between GetPathStatus (eTag fetch) and the conditional create, another writer replaced or re-created the blob; the service returns 412 and the client maps it to this exception.","commonSituations":"Two tasks or jobs with identical output paths; overwrite races between appenders and creators; commit protocols where task pre-commit and job commit create the same file.","solutions":["Retry the whole create sequence — the next round fetches a fresh eTag and either succeeds or detects a stable state","Guarantee a single writer per output path (unique per-attempt names, commit coordinator)","Disable speculative duplication for these writes"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  fs.create(path, false).close();\n} catch (ConcurrentWriteOperationDetectedException e) {\n  // eTag raced (412): refetch state and retry the whole create sequence\n  sleepBackoff();\n  fs.create(path, false).close();\n}","preventionTips":["Guarantee a single writer per output path (per-attempt unique names, then commit/rename)","Disable speculative task duplication for deterministic outputs","Treat ConcurrentWriteOperationDetectedException as a retryable race signal, not data corruption"],"tags":["azure","abfs","concurrency","etag","precondition-failed","blob-endpoint"],"backgroundTag":"concurrent-write-conflict","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}