{"record":{"id":"d21d8e91b6349105","repo":"apache/hadoop","slug":"testlibhdfs-must-have-a-number-of-threads-between","errorCode":null,"errorMessage":"testLibHdfs: must have a number of threads between 1 and %d inclusive, not %d\n","messagePattern":"testLibHdfs: must have a number of threads between 1 and (.+?) inclusive, not (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/test_libhdfs_threaded.c","lineNumber":439,"sourceCode":"    const char *tlhNumThreadsStr;\n    struct tlhThreadInfo ti[TLH_MAX_THREADS];\n    struct NativeMiniDfsConf conf = {\n        1, /* doFormat */\n    };\n\n    /* Check that the recursive mutex works as expected */\n    if (testRecursiveJvmMutex() < 0) {\n        fprintf(stderr, \"testRecursiveJvmMutex failed\\n\");\n        return EXIT_FAILURE;\n    }\n\n    tlhNumThreadsStr = getenv(\"TLH_NUM_THREADS\");\n    if (!tlhNumThreadsStr) {\n        tlhNumThreadsStr = \"3\";\n    }\n    tlhNumThreads = atoi(tlhNumThreadsStr);\n    if ((tlhNumThreads <= 0) || (tlhNumThreads > TLH_MAX_THREADS)) {\n        fprintf(stderr, \"testLibHdfs: must have a number of threads \"\n                \"between 1 and %d inclusive, not %d\\n\",\n                TLH_MAX_THREADS, tlhNumThreads);\n        return EXIT_FAILURE;\n    }\n    memset(&ti[0], 0, sizeof(ti));\n    for (i = 0; i < tlhNumThreads; i++) {\n        ti[i].threadIdx = i;\n    }\n\n    tlhCluster = nmdCreate(&conf);\n    EXPECT_NONNULL(tlhCluster);\n    EXPECT_ZERO(nmdWaitClusterUp(tlhCluster));\n\n    for (i = 0; i < tlhNumThreads; i++) {\n        ti[i].theThread.start = testHdfsOperations;\n        ti[i].theThread.arg = &ti[i];\n        EXPECT_ZERO(threadCreate(&ti[i].theThread));\n    }","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/test_libhdfs_threaded.c#L421-L457","documentation":"Error \"testLibHdfs: must have a number of threads between 1 and %d inclusive, not %d\n\" thrown in apache/hadoop.","triggerScenarios":"Argument validation in testLibHdfs main: the -t thread count is outside [1, TLH_MAX_THREADS].","commonSituations":"User ran the test binary with an out-of-range -t value, e.g. -t 0 or a value larger than the maximum supported.","solutions":["Pass a thread count between 1 and the printed maximum via the -t option.","Use a positive thread count; 0 or negative values are rejected.","Do not exceed the compiled-in maximum thread count shown in the message."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}