{"record":{"id":"9c5ace60c06bbd90","repo":"apache/hadoop","slug":"progress-option-is-set-multiple-times","errorCode":null,"errorMessage":"Progress option is set multiple times","messagePattern":"Progress option is set multiple times","errorType":"validation","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":584,"sourceCode":"          throw new HadoopIllegalArgumentException(\n              \"BytesPerChecksum option is set multiple times\");\n        }\n        bytesPerChecksum = ((CreateOpts.BytesPerChecksum) iOpt).getValue();\n      } else if (CreateOpts.ChecksumParam.class.isInstance(iOpt)) {\n        if (checksumOpt != null) {\n          throw new  HadoopIllegalArgumentException(\n              \"CreateChecksumType option is set multiple times\");\n        }\n        checksumOpt = ((CreateOpts.ChecksumParam) iOpt).getValue();\n      } else if (CreateOpts.Perms.class.isInstance(iOpt)) {\n        if (permission != null) {\n          throw new HadoopIllegalArgumentException(\n              \"Perms option is set multiple times\");\n        }\n        permission = ((CreateOpts.Perms) iOpt).getValue();\n      } else if (CreateOpts.Progress.class.isInstance(iOpt)) {\n        if (progress != null) {\n          throw new HadoopIllegalArgumentException(\n              \"Progress option is set multiple times\");\n        }\n        progress = ((CreateOpts.Progress) iOpt).getValue();\n      } else if (CreateOpts.CreateParent.class.isInstance(iOpt)) {\n        if (createParent != null) {\n          throw new HadoopIllegalArgumentException(\n              \"CreateParent option is set multiple times\");\n        }\n        createParent = ((CreateOpts.CreateParent) iOpt).getValue();\n      } else {\n        throw new HadoopIllegalArgumentException(\"Unkown CreateOpts of type \" +\n            iOpt.getClass().getName());\n      }\n    }\n    if (permission == null) {\n      throw new HadoopIllegalArgumentException(\"no permission supplied\");\n    }\n","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L566-L602","documentation":"AbstractFileSystem.create accepts CreateOpts.Progress at most once; a second Progressable option in the varargs throws HadoopIllegalArgumentException before the file is created. The progress callback must be unambiguous, hence the strict single-occurrence rule.","triggerScenarios":"Two CreateOpts.progress(...) entries in one create() call — e.g. a job framework attaching its own progressable after the application already supplied one.","commonSituations":"Frameworks (MR/Tez-style runners, connectors) that auto-attach progress reporters layered over application opts via concatenation.","solutions":["Attach CreateOpts.progress exactly once; drop the redundant one","Use CreateOpts.setOpt(CreateOpts.progress(p), opts) to replace","Dedupe opts by class in shared create wrappers"],"exampleFix":"// before\nfc.create(f, flag, CreateOpts.progress(cb1), CreateOpts.progress(cb2));\n\n// after\nfc.create(f, flag, CreateOpts.progress(cb2));","handlingStrategy":"validation","validationCode":"opts = CreateOpts.setOpt(CreateOpts.progress(callback), opts); // replaces any existing Progress option","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Attach the progressable in one layer only","Frameworks should check CreateOpts.getOpt(Progress.class, opts) before injecting their own","Dedupe opts by class in shared create wrappers"],"tags":["hadoop","file-create","options","progress","varargs"],"backgroundTag":"duplicate-create-option","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}