NPE when doing multi-exec against cluster

99 views
Skip to first unread message

Roy Varghese

unread,
Feb 3, 2016, 3:34:30 AM2/3/16
to lettuce-redis-client-users
Hi
I am trying the code example of multi-exec against a 3 master cluster, all running on localhost..

            RedisClusterClient rcc = RedisClusterClient.create(uris);
            cconn = rcc.connect();
            RedisAdvancedClusterCommands ccommands = cconn.sync();

            ccommands.multi();

            ccommands.set("one", "1");
            ccommands.set("two", "2");
            ccommands.mget("one", "two");
            ccommands.lpush("list", "11");
            ccommands.llen("list");

            ccommands.exec();

But the exec() throws an NPE error:

java.lang.NullPointerException
at com.lambdaworks.redis.cluster.ClusterDistributionChannelWriter.write(ClusterDistributionChannelWriter.java:99)
at com.lambdaworks.redis.RedisChannelHandler.dispatch(RedisChannelHandler.java:106)
at com.lambdaworks.redis.cluster.StatefulRedisClusterConnectionImpl.dispatch(StatefulRedisClusterConnectionImpl.java:189)
at com.lambdaworks.redis.AbstractRedisAsyncCommands.dispatch(AbstractRedisAsyncCommands.java:1726)
at com.lambdaworks.redis.AbstractRedisAsyncCommands.dispatch(AbstractRedisAsyncCommands.java:1721)
at com.lambdaworks.redis.AbstractRedisAsyncCommands.dispatch(AbstractRedisAsyncCommands.java:1717)
at com.lambdaworks.redis.AbstractRedisAsyncCommands.exec(AbstractRedisAsyncCommands.java:351)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.lambdaworks.redis.cluster.StatefulRedisClusterConnectionImpl$ClusterFutureSyncInvocationHandler.handleInvocation(StatefulRedisClusterConnectionImpl.java:334)
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy4.exec(Unknown Source)

What could be wrong? I can see that the keys are being created in the redis db across the 3 different cluster instances.
I am using 4.1.Final

-Roy

Mark Paluch

unread,
Feb 3, 2016, 3:38:29 AM2/3/16
to Roy Varghese, lettuce-redis-client-users
Hi Roy, 
Redis Cluster and MULTI aren't supported in a sane way yet. Could you file a ticket at https://github.com/mp911de/lettuce/issues?

Thanks, Mark

--
You received this message because you are subscribed to the Google Groups "lettuce-redis-client-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-clien...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lettuce-redis-client-users/b6567b14-036f-45f5-ae31-966c5fbe6ac4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roy Varghese

unread,
Feb 3, 2016, 3:55:39 AM2/3/16
to lettuce-redis-client-users
Hi Mark, 

I've filed issue #187; looks like you already noticed.

Meanwhile, what's the recommended way for running transactions against clusters?
I can restrict my transaction to keys in the same shard/cluster-node. I see an example of connecting to a node here
but how do I know which node to pick?

Thanks
Roy

To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-client-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages