You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (JIRA)" <ji...@apache.org> on 2013/05/01 01:06:16 UTC
[jira] [Commented] (AVRO-607) SpecificData.getSchema not
thread-safe
[ https://issues.apache.org/jira/browse/AVRO-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646114#comment-13646114 ]
Doug Cutting commented on AVRO-607:
-----------------------------------
> In Avro code, a weak concurrent hash map is in high demand.
Might we add a org.apache.avro.util.WeakConcurrentMap<T> class that's a ConncurrentHashMap<WeakReference<T>>? We already have our own WeakIdentityHashMap...
> SpecificData.getSchema not thread-safe
> --------------------------------------
>
> Key: AVRO-607
> URL: https://issues.apache.org/jira/browse/AVRO-607
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.3.3
> Reporter: Stephen Tu
> Priority: Minor
> Attachments: AVRO-607.patch
>
>
> SpecificData.getSchema uses a WeakHashMap to cache schemas, but WeakHashMap is not thread-safe, and the method itself is not synchronized. Seems like this could lead to the data structure getting corrupted.
--
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