Return-Path: X-Original-To: apmail-avro-dev-archive@www.apache.org Delivered-To: apmail-avro-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D8BF210343 for ; Tue, 30 Apr 2013 18:26:16 +0000 (UTC) Received: (qmail 16897 invoked by uid 500); 30 Apr 2013 18:26:16 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 16804 invoked by uid 500); 30 Apr 2013 18:26:16 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 16795 invoked by uid 99); 30 Apr 2013 18:26:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 18:26:16 +0000 Date: Tue, 30 Apr 2013 18:26:16 +0000 (UTC) From: "Scott Carey (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AVRO-607) SpecificData.getSchema not thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AVRO-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645811#comment-13645811 ] Scott Carey commented on AVRO-607: ---------------------------------- I quite like Guava, Having a concurrent weak hash map is great, and the Immutable collections are very useful, and several other collection types are massive time savers (Multiset, Multimap and BiMap). However, items get deprecated and dissapear in 2 years in Guava, so we would have to avoid the newest APIs and quickly move off of deprecated ones to prevent users who also use it from coming into conflict. It is manageable, but it is a dependency that is very likely to be used by our users, and if we are on version 11 while a user is on 13, we could be in a position where neither version works for both of us simultaneously. I also worry about our place as a library far down the stack for some users. We could complicate our build to shade in only the classes we use under a different namespace to avoid such problems (this may be useful for other dependencies as well). > 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