[
https://issues.apache.org/jira/browse/PHOENIX-4074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16117730#comment-16117730
]
James Taylor commented on PHOENIX-4074:
---------------------------------------
The code no longer runs against multiple, simultaneous threads, but I still
like your fix. I'll make it on top of my changes.
> Race condition in LazyValueGetter
> ---------------------------------
>
> Key: PHOENIX-4074
> URL: https://issues.apache.org/jira/browse/PHOENIX-4074
> Project: Phoenix
> Issue Type: Bug
> Reporter: Samarth Jain
> Attachments: PHOENIX-4074.patch
>
>
> There is a race condition between acquiring the lock and the values map being
> initialized here.
> {code}
> @Override
> public ImmutableBytesWritable getLatestValue(ColumnReference ref) throws
> IOException {
> // ensure we have a backing map
> if (values == null) {
> synchronized (this) {
> values = Collections.synchronizedMap(new HashMap<ColumnReference,
> ImmutableBytesWritable>());
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)