[
https://issues.apache.org/jira/browse/HADOOP-911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466314
]
Christian Kunz commented on HADOOP-911:
---------------------------------------
Fixing the storage into the hashtable brings up another issue: thread ids seem
to get recycled such that multi-threaded applications using threads with
limited lifetime might crash when spawning new threads, i.e. insertion of
thread ids into a hashtable is useless. And it is not necessary because
AttachCurrentThread can easily be called multiple times for already attached
threads without performance penalty (according to documentation basically a
no-op).
On the other hand, the library should also contain a function that calls
DetachCurrentThread to avoid leaks (of course, no big deal for applications
that use a relatively small number of threads or a thread pool).
> Multithreading issue with libhdfs library
> -----------------------------------------
>
> Key: HADOOP-911
> URL: https://issues.apache.org/jira/browse/HADOOP-911
> Project: Hadoop
> Issue Type: Bug
> Components: libhdfs
> Affects Versions: 0.9.2
> Reporter: Christian Kunz
>
> Multithreaded applications using libhdfs sometimes run into
> IllegalMonitorStateException or plainly lock up (strace shows a thread being
> in a loop of calling sched_yield). It probably has to do with the fact that
> libhdfs does not ensure proper allocation of hashtable entries that map a
> threadId to JNI interface pointer.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira