{"record":{"id":"b68b35479f13d5aa","repo":"apache/hadoop","slug":"vecsum-normal-loop-pass-d-failed-with-error-d-n","errorCode":null,"errorMessage":"vecsum_normal_loop pass %d failed with error %d\\n","messagePattern":"vecsum_normal_loop pass (.+?) failed with error (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c","lineNumber":719,"sourceCode":"    printf(\"finished normal pass %d.  sum = %g\\n\", pass, sum);\n    return 0;\n}\n\nstatic int vecsum_libhdfs(struct libhdfs_data *ldata,\n            const struct options *opts)\n{\n    int pass;\n\n    ldata->buf = malloc(NORMAL_READ_CHUNK_SIZE);\n    if (!ldata->buf) {\n        fprintf(stderr, \"failed to malloc buffer of size %d\\n\",\n            NORMAL_READ_CHUNK_SIZE);\n        return ENOMEM;\n    }\n    for (pass = 0; pass < opts->passes; ++pass) {\n        int ret = vecsum_normal_loop(pass, ldata, opts);\n        if (ret) {\n            fprintf(stderr, \"vecsum_normal_loop pass %d failed \"\n                \"with error %d\\n\", pass, ret);\n            return ret;\n        }\n        hdfsSeek(ldata->fs, ldata->file, 0);\n    }\n    return 0;\n}\n\nstatic void vecsum_local(struct local_data *cdata, const struct options *opts)\n{\n    int pass;\n\n    for (pass = 0; pass < opts->passes; pass++) {\n        double sum = vecsum(cdata->mmap, cdata->length / sizeof(double));\n        printf(\"finished vecsum_local pass %d.  sum = %g\\n\", pass, sum);\n    }\n}\n","sourceCodeStart":701,"sourceCodeEnd":737,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c#L701-L737","documentation":"Wrapper error: vecsum_libhdfs() reports that normal-read pass N failed with the code returned by vecsum_normal_loop() and returns immediately, skipping the remaining passes. The root cause was printed one line earlier inside the loop.","triggerScenarios":"Any nonzero return from vecsum_normal_loop(): hdfsReadFully() failing (errno case) or a partial read because the file length is not a multiple of NORMAL_READ_CHUNK_SIZE.","commonSituations":"Same as the underlying read errors: DataNode/network problems mid-benchmark, unaligned -l length, file deleted during the run.","solutions":["Look at the stderr line immediately preceding this one (hdfsRead failed with error N / partial read of length N) — that is the actionable error.","Fix per that message (cluster stability, aligned length, file exists), then re-run."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"/* prevent the underlying loop errors */\nif (opts->length % NORMAL_READ_CHUNK_SIZE) return EINVAL;\nif (hdfsExists(ldata->fs, opts->path) != 0) return ENOENT;","typeGuard":null,"tryCatchPattern":"ret = vecsum_normal_loop(pass, ldata, opts);\nif (ret) {\n    /* ret == errno from hdfsRead or EINVAL from partial read;\n       only transient errno values justify a full-pass retry after hdfsSeek */\n}","preventionTips":["Interpret the printed error code together with the line printed just above it by the loop.","Fix deterministic causes (alignment, missing file) before any retry.","Keep per-pass error codes in scripts so you can classify failures automatically."],"tags":["hdfs","vecsum","wrapper","read"],"backgroundTag":"hdfs-read-failure","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}