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 AD8FE200C3B for ; Sat, 11 Feb 2017 00:32:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AC2F1160B5C; Fri, 10 Feb 2017 23:32:08 +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 09A32160B69 for ; Sat, 11 Feb 2017 00:32:07 +0100 (CET) Received: (qmail 679 invoked by uid 500); 10 Feb 2017 23:32:06 -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 332 invoked by uid 99); 10 Feb 2017 23:32:06 -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; Fri, 10 Feb 2017 23:32:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 135A2E01BE; Fri, 10 Feb 2017 23:32:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jjirsa@apache.org To: commits@cassandra.apache.org Date: Fri, 10 Feb 2017 23:32:08 -0000 Message-Id: In-Reply-To: <3d359fb5fecc4afba73ad83e04bdd6b0@git.apache.org> References: <3d359fb5fecc4afba73ad83e04bdd6b0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/15] cassandra git commit: CASSANDRA-13159: Coalescing strategy can enter infinite loop archived-at: Fri, 10 Feb 2017 23:32:08 -0000 CASSANDRA-13159: Coalescing strategy can enter infinite loop Patch by Corentin Chary; Reviewed by Jeff Jirsa for CASSANDRA-13159 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f6a70578 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f6a70578 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f6a70578 Branch: refs/heads/cassandra-3.0 Commit: f6a7057815e66ba75253510b3ef6bad492381d94 Parents: eb0f443 Author: Jeff Jirsa Authored: Fri Feb 10 15:24:18 2017 -0800 Committer: Jeff Jirsa Committed: Fri Feb 10 15:24:18 2017 -0800 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/utils/CoalescingStrategies.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6a70578/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 0c7d129..5c86687 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.17 + * Coalescing strategy can enter infinite loop (CASSANDRA-13159) * Upgrade netty version to fix memory leak with client encryption (CASSANDRA-13114) * Fix paging for DISTINCT queries on partition keys and static columns (CASSANDRA-13017) * Fix race causing infinite loop if Thrift server is stopped before it starts listening (CASSANDRA-12856) http://git-wip-us.apache.org/repos/asf/cassandra/blob/f6a70578/src/java/org/apache/cassandra/utils/CoalescingStrategies.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/utils/CoalescingStrategies.java b/src/java/org/apache/cassandra/utils/CoalescingStrategies.java index ca1399b..6b69066 100644 --- a/src/java/org/apache/cassandra/utils/CoalescingStrategies.java +++ b/src/java/org/apache/cassandra/utils/CoalescingStrategies.java @@ -96,7 +96,7 @@ public class CoalescingStrategies { // only sleep if we can expect to double the number of messages we're sending in the time interval long sleep = messages * averageGap; - if (sleep > maxCoalesceWindow) + if (sleep <= 0 || sleep > maxCoalesceWindow) return false; // assume we receive as many messages as we expect; apply the same logic to the future batch: