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 E0250182DF for ; Wed, 29 Jul 2015 23:58:04 +0000 (UTC) Received: (qmail 82168 invoked by uid 500); 29 Jul 2015 23:58:04 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 82135 invoked by uid 500); 29 Jul 2015 23:58:04 -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 82121 invoked by uid 99); 29 Jul 2015 23:58:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2015 23:58:04 +0000 Date: Wed, 29 Jul 2015 23:58:04 +0000 (UTC) From: "Paulo Motta (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-7757) Possible Atomicity Violations in StreamSession and ThriftSessionManager 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/CASSANDRA-7757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14646938#comment-14646938 ] Paulo Motta commented on CASSANDRA-7757: ---------------------------------------- +1 > Possible Atomicity Violations in StreamSession and ThriftSessionManager > ----------------------------------------------------------------------- > > Key: CASSANDRA-7757 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7757 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Diogo Sousa > Assignee: Paulo Motta > Priority: Minor > Fix For: 2.1.x > > > I'm developing a tool for atomicity violation detection and I think it have found two atomicity violations in cassandra. > In org.apache.cassandra.streaming.StreamSession there might be an atomicity violation in method addTransferFiles(), lines 310-314: > {noformat} > 310: StreamTransferTask task = transfers.get(cfId); > if (task == null) > { > task = new StreamTransferTask(this, cfId); > 314: transfers.put(cfId, task); > } > {noformat} > A concurrent thread can insert a transfer with the same uuid creating two StreamTransferTask, and only one get into "transfers". > In org.apache.cassandra.thrift.ThriftSessionManager, a simular situation can occur in method currentSession(), lines 57-61: > {noformat} > 57: ThriftClientState cState = activeSocketSessions.get(socket); > if (cState == null) > { > cState = new ThriftClientState(socket); > 51: activeSocketSessions.put(socket, cState); > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)