You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org> on 2013/02/04 22:26:12 UTC
[jira] [Updated] (HADOOP-9252) StringUtils.humanReadableInt(..) has
a race condition
[ https://issues.apache.org/jira/browse/HADOOP-9252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tsz Wo (Nicholas), SZE updated HADOOP-9252:
-------------------------------------------
Description:
humanReadableInt(..) incorrectly uses oneDecimal without synchronization.
Also, limitDecimalTo2(double) correctly uses decimalFormat with synchronization. However, synchronization can be avoided for a better performance.
was:limitDecimalTo2(double) currently uses decimalFormat, which is a static field, so that it is synchronized. Synchronization is unnecessary since it can simply uses String.format(..).
Issue Type: Bug (was: Improvement)
Summary: StringUtils.humanReadableInt(..) has a race condition (was: StringUtils.limitDecimalTo2(..) is unnecessarily synchronized)
Hadoop Flags: Reviewed
Chris, thanks a lot for the careful review!
(Changed the issue type to Bug, and revised the summary and the description.)
> StringUtils.humanReadableInt(..) has a race condition
> -----------------------------------------------------
>
> Key: HADOOP-9252
> URL: https://issues.apache.org/jira/browse/HADOOP-9252
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Reporter: Tsz Wo (Nicholas), SZE
> Assignee: Tsz Wo (Nicholas), SZE
> Priority: Minor
> Attachments: c9252_20130127.patch, c9252_20130128.patch, c9252_20130203.patch, c9252_20130204.patch
>
>
> humanReadableInt(..) incorrectly uses oneDecimal without synchronization.
> Also, limitDecimalTo2(double) correctly uses decimalFormat with synchronization. However, synchronization can be avoided for a better performance.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira