hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiqun Lin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-10549) Memory leak if exception happens when closing DFSOutputStream or DFSStripedOutputStream
Date Mon, 20 Jun 2016 02:34:05 GMT

     [ https://issues.apache.org/jira/browse/HDFS-10549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yiqun Lin updated HDFS-10549:
-----------------------------
    Description: 
As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in {{DFSOutputStream}}
will not be executed when the IOException happened in {{closeImpl()}}.
{code}
  public void close() throws IOException {
    synchronized (this) {
      try (TraceScope ignored =
          dfsClient.newPathTraceScope("DFSOutputStream#close", src)) {
        closeImpl();
      }
    }
    dfsClient.endFileLease(fileId);
    }
  }
{code}
This will cause that the files not be closed in {{DFSClient}} and finally lead to the memory
leak. In {{DFSStripedOutputStream}}, it existed the same problem.

  was:
As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in {{ DFSOutputStream}}
will not be executed when the IOException happened in {{closeImpl()}}.
{code}
  public void close() throws IOException {
    synchronized (this) {
      try (TraceScope ignored =
          dfsClient.newPathTraceScope("DFSOutputStream#close", src)) {
        closeImpl();
      }
    }
    dfsClient.endFileLease(fileId);
    }
  }
{code}
This will cause that the files not be closed in {{DFSClient}} and finally lead to the memory
leak. In {{DFSStripedOutputStream}}, it existed the same problem.


> Memory leak if exception happens when closing DFSOutputStream or DFSStripedOutputStream
> ---------------------------------------------------------------------------------------
>
>                 Key: HDFS-10549
>                 URL: https://issues.apache.org/jira/browse/HDFS-10549
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 2.7.1
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-10549.001.patch
>
>
> As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in {{DFSOutputStream}}
will not be executed when the IOException happened in {{closeImpl()}}.
> {code}
>   public void close() throws IOException {
>     synchronized (this) {
>       try (TraceScope ignored =
>           dfsClient.newPathTraceScope("DFSOutputStream#close", src)) {
>         closeImpl();
>       }
>     }
>     dfsClient.endFileLease(fileId);
>     }
>   }
> {code}
> This will cause that the files not be closed in {{DFSClient}} and finally lead to the
memory leak. In {{DFSStripedOutputStream}}, it existed the same problem.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message