{"record":{"id":"549804e012cb6307","repo":"apache/hadoop","slug":"testrecursivejvmmutex-failed","errorCode":null,"errorMessage":"testRecursiveJvmMutex failed\n","messagePattern":"testRecursiveJvmMutex failed\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":429,"sourceCode":"\n    return 0;\n}\n\n/**\n * Test that we can write a file with libhdfs and then read it back\n */\nint main(void)\n{\n    int i, tlhNumThreads;\n    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    }","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/test_libhdfs_threaded.c#L411-L447","documentation":"Error \"testRecursiveJvmMutex failed\n\" thrown in apache/hadoop.","triggerScenarios":"Printed at the end of testRecursiveJvmMutex when recursive acquisition of the JVM mutex via getJNIEnv failed.","commonSituations":"Follows a failed getJNIEnv call in the recursive mutex unit test, usually due to missing or destroyed JVM state.","solutions":["Look at the earlier 'getJNIEnv failed' message for the root cause; this line is only the test verdict.","Ensure the libjvm library path (LD_LIBRARY_PATH/LIBHDFS_OPTS) is correct so JNI attach can succeed."],"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-22T20:17:22.307Z"}