You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Jungtaek Lim <ka...@gmail.com> on 2017/12/12 09:39:24 UTC
Review Request 64531: AMBARI-22633 MapDate provides the date
incorrectly when Filter is cloned and used in multi-threads
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64531/
-----------------------------------------------------------
Review request for Ambari, Miklos Gergely, Oliver Szabo, and Sid Wagle.
Bugs: AMBARI-22633
https://issues.apache.org/jira/browse/AMBARI-22633
Repository: ambari
Description
-------
In AMBARI-22600, we cloned the Filter instance to assign the instance per child thread, which also clones the map of Mapper. Other Mapper implements only have String(s) type of fields hence thread-safe, but MapperDate has SimpleDateFormat type of fields which is known as non thread-safe, so cloning the Filter which has one or more MapperDate and using them concurrently makes multi-threads issue.
Replacing SimpleDateFormat with FastDateFormat in commons-lang3 would resolve the issue.
Diffs
-----
ambari-logsearch/ambari-logsearch-logfeeder/pom.xml a06ae902fc
ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java 6a7fad7b70
Diff: https://reviews.apache.org/r/64531/diff/1/
Testing
-------
- existing unit tests
- manual tests (manually deploying to cluster)
Thanks,
Jungtaek Lim
Re: Review Request 64531: AMBARI-22633 MapDate provides the date
incorrectly when Filter is cloned and used in multi-threads
Posted by Oliver Szabo <os...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64531/#review193537
-----------------------------------------------------------
Ship it!
Pobably that would be better if we would clone all of the mapper types as well. But that wont hurt so +1
- Oliver Szabo
On Dec. 12, 2017, 9:39 a.m., Jungtaek Lim wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64531/
> -----------------------------------------------------------
>
> (Updated Dec. 12, 2017, 9:39 a.m.)
>
>
> Review request for Ambari, Miklos Gergely, Oliver Szabo, and Sid Wagle.
>
>
> Bugs: AMBARI-22633
> https://issues.apache.org/jira/browse/AMBARI-22633
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In AMBARI-22600, we cloned the Filter instance to assign the instance per child thread, which also clones the map of Mapper. Other Mapper implements only have String(s) type of fields hence thread-safe, but MapperDate has SimpleDateFormat type of fields which is known as non thread-safe, so cloning the Filter which has one or more MapperDate and using them concurrently makes multi-threads issue.
>
> Replacing SimpleDateFormat with FastDateFormat in commons-lang3 would resolve the issue.
>
>
> Diffs
> -----
>
> ambari-logsearch/ambari-logsearch-logfeeder/pom.xml a06ae902fc
> ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java 6a7fad7b70
>
>
> Diff: https://reviews.apache.org/r/64531/diff/1/
>
>
> Testing
> -------
>
> - existing unit tests
> - manual tests (manually deploying to cluster)
>
>
> Thanks,
>
> Jungtaek Lim
>
>