hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7494) Checking of closed in DFSInputStream#pread() should be protected by synchronization
Date Sat, 13 Dec 2014 00:38:13 GMT

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

Colin Patrick McCabe commented on HDFS-7494:
--------------------------------------------

{code}
665	    if (!closed.compareAndSet(false, true)) {
666	      DFSClient.LOG.warn("DFSInputStream has been closed already");
666	    }
{code}

We should return here, not keep going

+1 when that's addressed

> Checking of closed in DFSInputStream#pread() should be protected by synchronization
> -----------------------------------------------------------------------------------
>
>                 Key: HDFS-7494
>                 URL: https://issues.apache.org/jira/browse/HDFS-7494
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>            Priority: Minor
>         Attachments: hdfs-7494-001.patch
>
>
> {code}
>   private int pread(long position, byte[] buffer, int offset, int length)
>       throws IOException {
>     // sanity checks
>     dfsClient.checkOpen();
>     if (closed) {
> {code}
> Checking of closed should be protected by holding lock on "DFSInputStream.this"



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

Mime
View raw message