cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Resolved] (CASSANDRA-5779) sudden NPE while accessing Cassandra with CQL driver
Date Mon, 22 Jul 2013 09:26:49 GMT


Sylvain Lebresne resolved CASSANDRA-5779.

       Resolution: Fixed
    Fix Version/s: 1.2.7
         Assignee: Sylvain Lebresne

bq. However, I suppose that NPE is not good anyway, I'd rather prefer to get "table doesn't
exist" message

I agree with you in theory. Ideally, we'd want to throw a meaningful error message for the
query. However, the problem here is that you dropped the keyspace concurrently of inserting
in that keyspace. And making sure we catch such race properly in all cases would, while probably
possible, be prohibitive performance wise for queries (and distribution makes this even worst).
It's just not worse it.

So at the end of the day, concurrently dropping a table/keyspace while requesting it (reads
or writes) is just not supported you should synchonize client side to avoid it.

For what it's worth, I've committed a small change (commit 86a077a190a1cec89112b9f1fd991f0fe06d2423)
so that this case shouldn't happen anymore. Instead, in that same situation, an assertion
error would get triggered that should at least have a more meaningful error message. And so
I'll consider this "fixed".  But:
# this will still not be an error returned to the client. So really, you should synchronize
client side.
# I do not pretend that a race between a keyspace drop and inserts can't yield a NPE anywhere
else in the code.

> sudden NPE while accessing Cassandra with CQL driver
> ----------------------------------------------------
>                 Key: CASSANDRA-5779
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.6
>            Reporter: Irina Chernushina
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.2.7
> java.lang.NullPointerException at org.apache.cassandra.db.RowMutation.addOrGet(
>  at org.apache.cassandra.cql3.statements.UpdateStatement.mutationForKey(
>  at org.apache.cassandra.cql3.statements.UpdateStatement.getMutations(
>  at org.apache.cassandra.cql3.statements.BatchStatement.getMutations(
> at org.apache.cassandra.cql3.statements.ModificationStatement.execute(
> at org.apache.cassandra.cql3.QueryProcessor.processStatement(
> at org.apache.cassandra.cql3.QueryProcessor.process(
> at org.apache.cassandra.transport.messages.QueryMessage.execute(
> at org.apache.cassandra.transport.Message$Dispatcher.messageReceived(
> at
> at
> at$DefaultChannelHandlerContext.sendUpstream(
> at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(
> at
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> at java.util.concurrent.ThreadPoolExecutor$
> at

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:

View raw message