redis client 2.0.0 pipeline 的list的rpop bug
描写叙述:
redis client 2.0.0 pipeline 的list的rpop 存在严重bug,rpop list的时候,假设list已经为空的时候,rpop出来的Response依旧不为null,导致吊response.get()方法抛异常
代码:
@Test
public void testRedisPipeline(){
Jedis jedis = null;
try{
jedis = new Jedis("127.0.0.1",6379);
Pipeline pipelined = jedis.pipelined();
for(int i=200;i<10000;i++){
pipelined.lpush("aa", "val"+i);
}
pipelined.sync(); }catch(Exception e){
e.printStackTrace();
}finally{
if(jedis!=null){
jedis.disconnect();
}
}
}
<span style="white-space:pre"> </span>//这种方法会造成redis qps无限上升
@Test
public void testRedisPipelinePop(){
Jedis jedis = null;
try{
List<Response<String>> result = new ArrayList<Response<String>>();
jedis = new Jedis("127.0.0.1",6379);
Pipeline pipelined = jedis.pipelined();
for(int i=0;i<10;i++){
//System.out.println(i);
Response<String> rpop = pipelined.rpop("aa");
//System.out.println(rpop);
result.add(rpop);
}
pipelined.sync();
//Response<Long> r = pipelined.bitcount("aa");
for (Response<String> response : result) {
System.out.println(response.get());//异常
} }catch(Exception e){
e.printStackTrace();
}finally{
if(jedis!=null){
jedis.disconnect();
}
}
}
解决方法:
使用redis-cli 2.1.0以上版本号
redis client 2.0.0 pipeline 的list的rpop bug的更多相关文章
- [开源福利] FreeRedis 历时两年正式发布 v1.0 [C#.NET Redis Client]
最近很多 .net QQ 群无故被封停,特别是 wpf 群几乎全军覆没.依乐祝的 .net6交流群,晓晨的 .net跨平台交流群,导致很多码友流离失所无家可归,借此机会使用一次召唤术,有需要的请加群: ...
- 鏈接Redis報錯`AUTH` failed: ERR Client sent AUTH, but no password is set [tcp://127.0.0.1:6379]
問題 鏈接Redis報錯`AUTH` failed: ERR Client sent AUTH, but no password is set [tcp://127.0.0.1:6379] 解決 啟動 ...
- redis集群错误解决:/usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis/client.rb:79:in `call': ERR Slot 15495 is already busy (Redis::CommandError)
错误信息: /usr/lib/ruby/gems/1.8/gems/redis-3.0.0/lib/redis/client.rb:79:in `call': ERR Slot 15495 is al ...
- Redis 5.0.0 releases notes
Redis 5.0 release notes ======================= ---------------------------------------------------- ...
- Redis 3.0.0 正式版出炉,高性能 K/V 服务
Redis 3.0.0 正式版最终到来了,与 RC6 版本号比較.该版本号改进包含: * 修复了无磁盘的复制问题 (Oran Agra) * 在角色变化后对 BLPOP 复制进行測试 (Salvato ...
- Redis(1.5)Redis配置文件(4.0.14)
4.0.14 常用配置 bind 127.0.0.1 # 默认绑定本地,不写的话任何地址都可以访问 protected-mode yes #保护模式,如果没有设置bind 配置地址,也没有设置任何密码 ...
- Redis 3.0.0 集群部署
简述: 1.0.1:redis cluster的现状 目前redis支持的cluster特性 1):节点自动发现 2):slave->master 选举,集群容错 3):Hot reshardi ...
- 高屋建瓴 cocos2d-x-3.0架构设计 Cocos2d (v.3.0) rendering pipeline roadmap(原文)
Cocos2d (v.3.0) rendering pipeline roadmap Why (the vision) The way currently Cocos2d does rendering ...
- failed (1113: No mapping for the Unicode character exists in the target multi-byte code page), client: 127.0.0.1...
nginx部署网站后,访问域名,网页显示 500 Internal Server Error ,经查看发现nginx的error.log中有报错: failed (1113: No mapping ...
随机推荐
- RabbitMQ~消费者实时与消息服务器保持通话
这个文章主要介绍简单的消费者的实现,rabbitMQ实现的消费者可以对消息服务器进行实时监听,当有消息(生产者把消息推到服务器上之后),消费者可以自动去消费它,这通常是开启一个进程去维护这个对话,它与 ...
- layer实现在前台删除前确认弹出框,并回调后台删除事件
最近遇到一些问题,用layer提示消息框,比如删除时,提示消息确定后 return false时,则不管用了,因为layer不支持阻塞,下面就解决一下这个问题:(本文使用Xcode,如要学习,请复下面 ...
- centos mysql允许远程root登录
Mysql为了安全性,在默认情况下用户只允许在本地登录,可是在有此情况下,还是需要使用用户进行远程连接,因此为了使其可以远程需要进行如下操作: 一.允许root用户在任何地方进行远程登录,并具有所有库 ...
- input获得焦点和失去焦点
总结:placeholder因为在IE7 8 9 浏览器不支持所以没用它效果:当input获取光标的时候如果是默认提示则input内容为空.如果不是则为输入内容 当失去光标的时候, ...
- Android各种函数单位
该博客随时更新.因为每次写函数都会考虑这个单位是什么,所以嫌比较麻烦,在这里总结一下,方便以后使用. paint.setStrokeWidth() 单位是 px . paint.getStrokeWi ...
- Ajax——php基础知识(二)
header header('content-type:text/html; charset= utf-8');//设置编码格式为:utf-8 header('location:http://www. ...
- ZipMarket数字内容/素材交易网站源码项目
ZipMarket程序仿自Envato旗下网站,对于想创建数字内容/素材交易平台的站长来说,ZipMarket是一个十分独特和极具创新的解决方案,用户在你的网站注册并购买或出售数字内容/素材作品时,你 ...
- git生成ssh key及本地解决多个ssh key的问题
git生成ssh key及本地解决多个ssh key的问题 ssh是一种网络协议,用于计算机之间的加密登录.ssh原理及应用可参考: SSH原理与运用(一):远程登录 生成ssh key步骤 这里以配 ...
- ESLint =》tslint.json
结论:将ESLint提示注意()里面的规则属性在tslint.json中"rules": { } 里设置为false 1.ES6: ESLint提示"Require Ob ...
- Eclipse安装和使用TFS
第一步下载Tfs插件 去微软官网下载https://www.microsoft.com/en-us/download/details.aspx?id=4240 点击 选择下载 随便放置到一个本地或者服 ...