hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Lowe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-14902) LoadGenerator#genFile write close timing is incorrectly calculated
Date Tue, 26 Sep 2017 22:13:00 GMT

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

Jason Lowe commented on HADOOP-14902:
-------------------------------------

Thanks for the patch!

Since genFile already throws IOExceptions for write errors, it seems incorrect to suppress
errors encountered during close.  IMHO they should be treated the same, otherwise callers
of genFIle may believe the file was written properly when it wasn't.  Therefore I think we
can simplify it a bit where we don't need a nested try block.  All we need to do is track
whether the file was closed within the try block and have the finally block close it if necessary
with a straight out.close().  The exception can propagate out just as it would for a write
error.




> LoadGenerator#genFile write close timing is incorrectly calculated
> ------------------------------------------------------------------
>
>                 Key: HADOOP-14902
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14902
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.4.0
>            Reporter: Jason Lowe
>            Assignee: Hanisha Koneru
>         Attachments: HADOOP-14902.001.patch
>
>
> LoadGenerator#genFile's write close timing code looks like the following:
> {code}
>         startTime = Time.now();
>         executionTime[WRITE_CLOSE] += (Time.now() - startTime);
> {code}
> That code will generate a zero (or near zero) write close timing since it isn't actually
closing the file in-between timestamp lookups.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message