sahilTakiar commented on a change in pull request #595: HDFS-14304: High lock
contention on hdfsHashMutex in libhdfs
URL: https://github.com/apache/hadoop/pull/595#discussion_r267097811
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
##########
@@ -534,6 +545,21 @@ JNIEnv* getJNIEnv(void)
state->env = getGlobalJNIEnv();
mutexUnlock(&jvmMutex);
+
+ if (!jclassesInitialized) {
+ mutexLock(&jclassInitMutex);
+ if (!jclassesInitialized) {
Review comment:
Fixed. Removed the first `if` statement, so `initCachedClasses` always
acquires the lock.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]