Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 663396BD8 for ; Mon, 13 Jun 2011 15:48:15 +0000 (UTC) Received: (qmail 96564 invoked by uid 500); 13 Jun 2011 15:48:15 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 96539 invoked by uid 500); 13 Jun 2011 15:48:15 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 96531 invoked by uid 99); 13 Jun 2011 15:48:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 15:48:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 15:48:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0E01C417D44 for ; Mon, 13 Jun 2011 15:47:52 +0000 (UTC) Date: Mon, 13 Jun 2011 15:47:52 +0000 (UTC) From: "Mck SembWever (JIRA)" To: commits@cassandra.apache.org Message-ID: <511668897.2804.1307980072054.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <502893843.8371.1307648459165.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-2755) ColumnFamilyRecordWriter fails to throw a write exception encountered after the user begins to close the writer 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 [ https://issues.apache.org/jira/browse/CASSANDRA-2755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048604#comment-13048604 ] Mck SembWever commented on CASSANDRA-2755: ------------------------------------------ The check for the exception also occurs in ColumnFamilyRecordWriter.write(buf, value) -> RangeClient.put(pair) Isn't it possible the put(..) is being called while the RangeClient thread is inside close() ? (isn't write(..) called more often than close() ?) For this reason inside RangeClient.run() i assigned lastException before calling close() > ColumnFamilyRecordWriter fails to throw a write exception encountered after the user begins to close the writer > --------------------------------------------------------------------------------------------------------------- > > Key: CASSANDRA-2755 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2755 > Project: Cassandra > Issue Type: Bug > Components: Hadoop > Affects Versions: 0.8.0 > Reporter: Greg Katz > Assignee: Mck SembWever > Attachments: 2755-v2.txt, CASSANDRA-2755.patch > > > There appears to be a race condition in {{ColumnFamilyRecordWriter}} that can result in the loss of an exception. Here is how it can happen (W stands for the {{RangeClient}}'s worker thread; U stands for the {{ColumnFamilyRecordWriter}} user's thread): > # W: {{RangeClient}}'s {{run}} method catches an exception originating in the Thrift client/socket, but doesn't get a chance to set it on the {{lastException}} field before it the thread is preempted. > # U: The user calls {{close}} which calls {{stopNicely}}. Because the {{lastException}} field is null, {{stopNicely}} does not throw anything. {{close}} then joins on the worker thread. > # W: The {{RangeClient}}'s {{run}} method sets the {{lastException}} field and exits. > # U: Although the thread in {{close}} is waiting for the worker thread to exit, it has already checked the {{lastException}} field so it doesn't detect the presence of the last exception. Instead, {{close}} returns without throwing anything. > This race condition means that intermittently write failures will go undetected. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira