Return-Path: Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: (qmail 46533 invoked from network); 26 Jan 2010 20:26:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jan 2010 20:26:59 -0000 Received: (qmail 35290 invoked by uid 500); 26 Jan 2010 20:26:58 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 35191 invoked by uid 500); 26 Jan 2010 20:26:58 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 35089 invoked by uid 99); 26 Jan 2010 20:26:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2010 20:26:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2010 20:26:55 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B4D96234C4AF for ; Tue, 26 Jan 2010 12:26:34 -0800 (PST) Message-ID: <864070416.46191264537594739.JavaMail.jira@brutus.apache.org> Date: Tue, 26 Jan 2010 20:26:34 +0000 (UTC) From: "robert Cook (JIRA)" To: common-dev@hadoop.apache.org Subject: [jira] Created: (HADOOP-6512) Complex Writable classes are not thread safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Complex Writable classes are not thread safe -------------------------------------------- Key: HADOOP-6512 URL: https://issues.apache.org/jira/browse/HADOOP-6512 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 0.20.1 Environment: hadoop 20.1, java 1.6.0_17, fedora Reporter: robert Cook While SequenceFile methods are properly "synchronized", the complex Writable classes are not thread safe. e.g. ArrayWritable, interleaved in... calls by different threads will scramble input public void readFields(DataInput in) throws IOException { values = new Writable[in.readInt()]; // construct values for (int i = 0; i < values.length; i++) { Writable value = WritableFactories.newInstance(valueClass); value.readFields(in); // read a value values[i] = value; // store it in values } } Please add synchronized prefixes. Not needed for simple types. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.