首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Redisson分布式重入锁异常

Redisson分布式重入锁异常
EN

Stack Overflow用户
提问于 2016-04-26 12:46:07
回答 1查看 1.7K关注 0票数 1

我使用redis 3.0.6 (4个节点集群)和RedissonVersion2.2.5。有时,当我试图锁定一个密钥时,我会得到以下异常:我的代码:

代码语言:javascript
运行
复制
    String key = String.valueOf("425011000000151");
    RLock lc = client.getLock(key);
    lc.lock(lockTime,TimeUnit.MILLISECONDS);
    System.out.println("Got key: " + key);
    lc.unlock();

错误:

代码语言:javascript
运行
复制
org.redisson.client.RedisException: ERR Error running script (call to f_93cfc048f82624d1670a310aa0ad58918c0824a5): @user_script:1: WRONGTYPE Operation against a key holding the wrong kind of value . channel: [id: 0x6280a1db, /10.135.50.64:59377 => /10.10.25.183:7002] command: CommandData [promise=DefaultPromise@79d4be49(incomplete), command=(EVAL), params=[if (redis.call('exists', KEYS[1]) == 0) then redis.call('publish', KEYS[2], ARGV[1]); return 1; end;if (redis.call('hexists', KEYS[1], ARGV[3]) == 0) then return nil;end; local counter = redis.call('hincrby', KEYS[1], ARGV[3], -1); if (counter > 0) then redis.call('pexpire', KEYS[1], ARGV[2]); return 0; else redis.call('del', KEYS[1]); redis.call('publish', KEYS[2], ARGV[1]); return 1; end; return nil;, 2, 425011000000151, redisson_lock__channel__{425011000000151}, 0, 30000, 15f636a8-4b5b-4351-9f55-14ade7a2cbd4:359], 

追踪:

代码语言:javascript
运行
复制
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:190) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:105) at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:370) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) at java.lang.Thread.run(Thread.java:744)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-27 06:50:37

我从“第四期”中得到了答案。

https://github.com/mrniko/redisson/issues/480

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36865391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档