[
https://issues.apache.org/jira/browse/HADOOP-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713061#action_12713061
]
Todd Lipcon commented on HADOOP-5859:
-------------------------------------
bq. which is ok assuming int assignments are atomic
I haven't had a chance to look through the patch, but in general this is not a
safe assumption. Although int assignment itself is atomic, if you don't do
access inside a synchronization block, there's no enforcement of a memory
barrier between threads, so one thread might not see the other thread's
assignment. Also, if someone later decides that size should be a long, long
assignment is not atomic on some JVM platforms. Thus the existence of
java.util.concurrent.atomic.AtomicInteger.
> FindBugs : fix "wait() or sleep() with locks held" warnings in hdfs
> -------------------------------------------------------------------
>
> Key: HADOOP-5859
> URL: https://issues.apache.org/jira/browse/HADOOP-5859
> Project: Hadoop Core
> Issue Type: Bug
> Components: dfs
> Reporter: Kan Zhang
> Assignee: Kan Zhang
> Attachments: 5859-21.patch, 5859-22.patch, 5859-26.patch,
> 5859-4.patch, 5859-5.patch, 5859-8.patch
>
>
> This JIRA fixes the following warnings:
> SWL org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.closeInternal() calls
> Thread.sleep() with a lock held
> TLW wait() with two locks held in
> org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.flushInternal()
> TLW wait() with two locks held in
> org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.flushInternal()
> TLW wait() with two locks held in
> org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.writeChunk(byte[], int, int,
> byte[])
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.