[
https://issues.apache.org/jira/browse/HADOOP-16282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16832694#comment-16832694
]
Daryn Sharp commented on HADOOP-16282:
--------------------------------------
Please consider reverting most or all of this patch.
I know finalized object are "bad" but this seemingly simple change is high risk
according to the linked java bug:
{quote}The unresolvable compatibility issue is the requirement in
FileInputStream and FileOutputStream finalizer methods to call close. ... Since
it is unknown/unknowable how many FIS/FOS subclasses might rely on overriding
close or finalize +_*the compatibility issue is severe*_+. +Only a long term
(multiple release) restriction to deprecate or invalidate overriding would have
possibility of eventually eliminating the compatibility problem.+
{quote}
As best I can tell, leak a NIO stream and forever leak the file descriptor.
The exceptions are completely different so anyone expecting to catch
{{FileNotFoundException}}, ie. at least from {{FileUtil}}, are going to be
surprised that it's now {{NoSuchFileException}}.
And please do not span components if at all possible. There is a hdfs project
for hdfs bugs.
> Avoid FileStream to improve performance
> ---------------------------------------
>
> Key: HADOOP-16282
> URL: https://issues.apache.org/jira/browse/HADOOP-16282
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: Ayush Saxena
> Assignee: Ayush Saxena
> Priority: Major
> Fix For: 3.3.0
>
> Attachments: HADOOP-16282-01.patch, HADOOP-16282-02.patch
>
>
> The FileInputStream and FileOutputStream classes contains a finalizer method
> which will cause garbage collection pauses. See
> [JDK-8080225|https://bugs.openjdk.java.net/browse/JDK-8080225] for details.
> The FileReader and FileWriter constructors instantiate FileInputStream and
> FileOutputStream, again causing garbage collection issues while finalizer
> methods are called.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]