{"record":{"id":"14bb60901fbebda2","repo":"apache/hadoop","slug":"parallel-access-to-the-create-path-detected-faili","errorCode":null,"errorMessage":"Parallel access to the create path detected. Failing request as the path which existed before gives not found error","messagePattern":"Parallel access to the create path detected\\. Failing request as the path which existed before gives not found error","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":661,"sourceCode":"          contextEncryptionAdapter, tracingContext);\n    }\n    AbfsRestOperation op;\n    try {\n      // Trigger a creation with overwrite=false first so that eTag fetch can be\n      // avoided for cases when no pre-existing file is present (major portion\n      // of create file traffic falls into the case of no pre-existing file).\n      op = createPathRestOp(relativePath, true, false,\n          isAppendBlob, null, contextEncryptionAdapter, tracingContext);\n    } catch (AbfsRestOperationException e) {\n      if (e.getStatusCode() == HTTP_CONFLICT) {\n        // File pre-exists, fetch eTag\n        try {\n          op = getPathStatus(relativePath, tracingContext, null, false);\n        } catch (AbfsRestOperationException ex) {\n          if (ex.getStatusCode() == HTTP_NOT_FOUND) {\n            // Is a parallel access case, as file which was found to be\n            // present went missing by this request.\n            throw new ConcurrentWriteOperationDetectedException(\"Parallel access to the create path detected. Failing request \"\n                + \"as the path which existed before gives not found error\");\n          } else {\n            throw ex;\n          }\n        }\n\n        // If present as an explicit empty directory, we should throw conflict exception.\n        boolean isExplicitDir = checkIsDir(op.getResult());\n        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 {","sourceCodeStart":643,"sourceCodeEnd":679,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java#L643-L679","documentation":"First race detector inside conditionalCreateOverwriteFile: the initial create with overwrite=false returns 409, so the client re-checks with GetPathStatus to fetch the eTag — but that call returns 404. The object that caused the conflict disappeared between the two calls, so the client throws ConcurrentWriteOperationDetectedException (an AzureBlobFileSystemException) rather than retrying blindly, honoring single-writer semantics.","triggerScenarios":"Two actors racing on the same path on a non-HNS account: writer A's create gets 409 because writer B's file exists; by the time A's status check runs, B (or a deleter) has removed it — 409 followed by 404 in one sequence.","commonSituations":"Concurrent jobs or speculative tasks writing identical output paths; commit-time races between task attempts and cleanup; external lifecycle-management policies deleting blobs mid-flight.","solutions":["Retry the create from the caller — the next attempt starts from a clean state","Serialize writers on the path (application-level lock, single committer, unique per-attempt file names)","Disable speculative execution for tasks that write deterministic output paths","Exclude active output prefixes from storage lifecycle/delete policies"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  fs.create(path, false).close();\n} catch (ConcurrentWriteOperationDetectedException e) {\n  // 409-then-404 race: state changed under us; one retry usually converges\n  fs.create(path, false).close();\n}","preventionTips":["Serialize writers per output path with unique per-attempt names or a committer","Disable speculative execution for tasks writing deterministic paths","Keep lifecycle/delete policies away from directories being written"],"tags":["azure","abfs","concurrency","race-condition","create","blob-endpoint"],"backgroundTag":"concurrent-write-conflict","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}