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 0A7D1F05F for ; Sat, 17 Aug 2013 04:50:50 +0000 (UTC) Received: (qmail 68660 invoked by uid 500); 17 Aug 2013 04:50:49 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 68556 invoked by uid 500); 17 Aug 2013 04:50:49 -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 68530 invoked by uid 99); 17 Aug 2013 04:50:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Aug 2013 04:50:48 +0000 Date: Sat, 17 Aug 2013 04:50:48 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-5893) CqlParser throws StackOverflowError on bigger batch operation 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-5893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742838#comment-13742838 ] Jonathan Ellis commented on CASSANDRA-5893: ------------------------------------------- Hmm. Can we at least catch the overflow and return InvalidRequest? > CqlParser throws StackOverflowError on bigger batch operation > ------------------------------------------------------------- > > Key: CASSANDRA-5893 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5893 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Vincent Mallet > Assignee: Aleksey Yeschenko > Fix For: 1.2.9 > > > We are seeing a problem with CQL3/Cassandra 1.2.8 where a large batch operation causes the CqlParser to throw a StackOverflowError (-Xss180k initially, then -Xss325k). > Shouldn't a batch be processed iteratively to avoid having to bump stack sizes to unreasonably large values? > Here is more info from the original problem description: > <<< > It looks like the CqlParser in 1.2.8 (probably 1.2.x, but i didn't look) is implemented recursively in such a way that large batch statements blow up the stack. We, of course on a Friday night, have a particular piece of code that's hitting a degenerate case that creates a batch of inserts with a VERY large number of collection items, and it manifests as a StackOverflow coming out the cass servers: > java.lang.StackOverflowError > at org.apache.cassandra.cql3.CqlParser.value(CqlParser.java:5266) > at org.apache.cassandra.cql3.CqlParser.term(CqlParser.java:5627) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4807) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4813) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4813) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4813) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4813) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4813) > at org.apache.cassandra.cql3.CqlParser.set_tail(CqlParser.java:4813) > ... > > I think in the short term I can give up the atomicity of a batch in this code and kind of suck it up, but obviously I'd prefer not to. I'm also not sure if I kept a single batch, but split this into smaller pieces in each statement, whether that would still fail. I'm guessing I could also crank the hell out of the stack size on the servers, but that feels pretty dirty. > It seems like the CqlParser should probably be implemented in a way that isn't quite so vulnerable to this, though I fully accept that this batch is koo-koo-bananas. > >>> > Thanks! > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira