Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1F435200B66 for ; Thu, 4 Aug 2016 02:53:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1E16C160A86; Thu, 4 Aug 2016 00:53:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 71407160AAA for ; Thu, 4 Aug 2016 02:53:55 +0200 (CEST) Received: (qmail 1387 invoked by uid 500); 4 Aug 2016 00:53:54 -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 1031 invoked by uid 99); 4 Aug 2016 00:53:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Aug 2016 00:53:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2BF71EC232; Thu, 4 Aug 2016 00:53:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stefania@apache.org To: commits@cassandra.apache.org Date: Thu, 04 Aug 2016 00:53:56 -0000 Message-Id: <35cdd56e2cde4e60b51fbbcee3cf0497@git.apache.org> In-Reply-To: <4e3ce2dcbaf74bcba2e226b5ef803cbb@git.apache.org> References: <4e3ce2dcbaf74bcba2e226b5ef803cbb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/6] cassandra git commit: Fixed ConcurrentModificationException when reading metrics in GraphiteReporter archived-at: Thu, 04 Aug 2016 00:53:56 -0000 Fixed ConcurrentModificationException when reading metrics in GraphiteReporter patch by Edward Ribeiro; reviewed by Stefania Alborghetti for CASSANDRA-11823 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/52be7bac Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/52be7bac Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/52be7bac Branch: refs/heads/trunk Commit: 52be7bac4160c392605f2ec6c2f98d4e49ccf2fe Parents: 3431934 Author: Edward Ribeiro Authored: Wed Aug 3 10:07:13 2016 +0800 Committer: Stefania Alborghetti Committed: Thu Aug 4 08:47:49 2016 +0800 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/metrics/TableMetrics.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/52be7bac/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index e8b8abb..f0ceb70 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.0.9 + * Fixed ConcurrentModificationException when reading metrics in GraphiteReporter (CASSANDRA-11823) * Fix upgrade of super columns on thrift (CASSANDRA-12335) * Fixed flacky BlacklistingCompactionsTest, switched to fixed size types and increased corruption size (CASSANDRA-12359) * Rerun ReplicationAwareTokenAllocatorTest on failure to avoid flakiness (CASSANDRA-12277) http://git-wip-us.apache.org/repos/asf/cassandra/blob/52be7bac/src/java/org/apache/cassandra/metrics/TableMetrics.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/metrics/TableMetrics.java b/src/java/org/apache/cassandra/metrics/TableMetrics.java index 85bf7f6..a21e8ca 100644 --- a/src/java/org/apache/cassandra/metrics/TableMetrics.java +++ b/src/java/org/apache/cassandra/metrics/TableMetrics.java @@ -20,6 +20,7 @@ package org.apache.cassandra.metrics; import java.nio.ByteBuffer; import java.util.*; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import com.codahale.metrics.*; @@ -788,7 +789,7 @@ public class TableMetrics */ private boolean register(String name, String alias, Metric metric) { - boolean ret = allTableMetrics.putIfAbsent(name, new HashSet<>()) == null; + boolean ret = allTableMetrics.putIfAbsent(name, ConcurrentHashMap.newKeySet()) == null; allTableMetrics.get(name).add(metric); all.put(name, alias); return ret;