hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7495) Remove updatePosition argument from DFSInputStream#getBlockAt()
Date Tue, 24 Feb 2015 02:52:11 GMT

    [ https://issues.apache.org/jira/browse/HDFS-7495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14334302#comment-14334302
] 

Ted Yu commented on HDFS-7495:
------------------------------

Thanks Colin for picking this up.

bq. this code isn't incorrect, it is just very, very tricky.

Agreed.

> Remove updatePosition argument from DFSInputStream#getBlockAt()
> ---------------------------------------------------------------
>
>                 Key: HDFS-7495
>                 URL: https://issues.apache.org/jira/browse/HDFS-7495
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.7.0
>            Reporter: Ted Yu
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: HDFS-7495.002.patch, hdfs-7495-001.patch
>
>
> There're two locks: one on DFSInputStream.this , one on DFSInputStream.infoLock
> Normally lock is obtained on infoLock, then on DFSInputStream.infoLock
> However, such order is not observed in DFSInputStream#getBlockAt() :
> {code}
>     synchronized(infoLock) {
> ...
>       if (updatePosition) {
>         // synchronized not strictly needed, since we only get here
>         // from synchronized caller methods
>         synchronized(this) {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message