Re: HDFS-6902 FileWriter should be closed in finally block in BlockReceiver#receiveBlock()

2014-08-25 Thread Colin McCabe
Let's discuss this on the JIRA. I think Tsuyoshi OZAWA's solution is good. Colin On Thu, Aug 21, 2014 at 7:08 AM, Ted Yu wrote: > bq. else there is a memory leak > > Moving call of close() would prevent the leak. > > bq. but then this code snippet could be java and can be messy > > The code is

Re: HDFS-6902 FileWriter should be closed in finally block in BlockReceiver#receiveBlock()

2014-08-21 Thread Ted Yu
bq. else there is a memory leak Moving call of close() would prevent the leak. bq. but then this code snippet could be java and can be messy The code is in Java. Cheers On Wed, Aug 20, 2014 at 10:00 PM, vlab wrote: > Unless you need 'out' later, have this statement. > FileWriter out(restartM

Re: [jira] [Created] (HDFS-6902) FileWriter should be closed in finally block in BlockReceiver#receiveBlock()

2014-08-20 Thread vlab
Unless you need 'out' later, have this statement. FileWriter out(restartMeta); then when exiting the try block, 'out' will go out of scope i assume this FileWriter that is create is delete'd else where (else there is a memory leak). {but then this code snippet could be java and can be messy.}

[jira] [Created] (HDFS-6902) FileWriter should be closed in finally block in BlockReceiver#receiveBlock()

2014-08-20 Thread Ted Yu (JIRA)
Ted Yu created HDFS-6902: Summary: FileWriter should be closed in finally block in BlockReceiver#receiveBlock() Key: HDFS-6902 URL: https://issues.apache.org/jira/browse/HDFS-6902 Project: Hadoop HDFS