Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 67956 invoked from network); 17 Sep 2008 20:34:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 20:34:37 -0000 Received: (qmail 51903 invoked by uid 500); 17 Sep 2008 20:34:31 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 51872 invoked by uid 500); 17 Sep 2008 20:34:31 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 51861 invoked by uid 99); 17 Sep 2008 20:34:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 13:34:31 -0700 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; Wed, 17 Sep 2008 20:33:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4AFF8234C1DA for ; Wed, 17 Sep 2008 13:33:44 -0700 (PDT) Message-ID: <702370052.1221683624306.JavaMail.jira@brutus> Date: Wed, 17 Sep 2008 13:33:44 -0700 (PDT) From: "Arun C Murthy (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-4195) SequenceFile.Writer close() uses compressor after returning it to CodecPool. In-Reply-To: <897205595.1221677744291.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-4195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arun C Murthy updated HADOOP-4195: ---------------------------------- Attachment: HADOOP-4195_0_20080917.patch Straight-forward fix... can you pls verify it Hong? Thanks! > SequenceFile.Writer close() uses compressor after returning it to CodecPool. > ---------------------------------------------------------------------------- > > Key: HADOOP-4195 > URL: https://issues.apache.org/jira/browse/HADOOP-4195 > Project: Hadoop Core > Issue Type: Bug > Components: io > Affects Versions: 0.18.0 > Reporter: Hong Tang > Assignee: Arun C Murthy > Fix For: 0.19.0 > > Attachments: HADOOP-4195_0_20080917.patch > > > In function SequenceFile.Writer.close() (line 946): The first marked line returns the compressor while the second marked line will use the compressor again. This will lead to a race condition if another thread checks out the compressor between these two marked statements. > {code:title=SequenceFile.java|borderStyle=solid} > public synchronized void close() throws IOException { > CodecPool.returnCompressor(compressor); // <==== compressor returned > > keySerializer.close(); > uncompressedValSerializer.close(); > if (compressedValSerializer != null) { > compressedValSerializer.close(); // <===== compressor used > } > if (out != null) { > > // Close the underlying stream iff we own it... > if (ownOutputStream) { > out.close(); > } else { > out.flush(); > } > out = null; > } > } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.