cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Jirsa (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-13159) Coalescing strategy can enter infinite loop
Date Thu, 26 Jan 2017 19:52:24 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-13159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15840313#comment-15840313
] 

Jeff Jirsa commented on CASSANDRA-13159:
----------------------------------------

Good catch, pushing to CI 

|| branch || testall || dtest ||
| https://github.com/jeffjirsa/cassandra/tree/cassandra-13159-2.1 | http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-2.1-testall/
| http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-2.1-dtest/ | 
| https://github.com/jeffjirsa/cassandra/tree/cassandra-13159-2.2  | http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-2.2-testall/
| http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-2.2-dtest/ | 
| https://github.com/jeffjirsa/cassandra/tree/cassandra-13159-3.0  | http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-3.0-testall/
| http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-3.0-dtest/ | 
| https://github.com/jeffjirsa/cassandra/tree/cassandra-13159-3.11  | http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-3.11-testall/
| http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-3.11-dtest/ |
| https://github.com/jeffjirsa/cassandra/tree/cassandra-13159  | http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-testall/
| http://cassci.datastax.com/job/jeffjirsa-cassandra-13159-dtest/ | 



> Coalescing strategy can enter infinite loop
> -------------------------------------------
>
>                 Key: CASSANDRA-13159
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13159
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Streaming and Messaging
>            Reporter: Corentin Chary
>            Assignee: Corentin Chary
>
> {code}boolean maybeSleep(int messages, long averageGap, long maxCoalesceWindow, Parker
parker){code} 
> maybeSleep() can enter an infinite loop if messages or averageGap ends up being 0 because
sleep will be 0 and the while loop will never exit. I've noticed that on one of my clusters
twice this week.
> This can happen if in averageGap() sum is bigger than MEASURED_INTERVAL, which should
be pretty rare but apparently happen to me.
> Even if the diagnostic is wrong (and I'm pretty sure that this thread was using 100%
CPU doing nothing), the fix seems pretty safe to apply.
> {code}
> diff --git a/src/java/org/apache/cassandra/utils/CoalescingStrategies.java b/src/java/org/apache/cassandra/utils/CoalescingStrategies.java
> index 0aa980f..982d4a6 100644
> --- a/src/java/org/apache/cassandra/utils/CoalescingStrategies.java
> +++ b/src/java/org/apache/cassandra/utils/CoalescingStrategies.java
> @@ -100,7 +100,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 || sleep > maxCoalesceWindow)
>              return false;
>  
>          // assume we receive as many messages as we expect; apply the same logic to
the future batch:
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message