描写叙述:

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的更多相关文章

  1. [开源福利] FreeRedis 历时两年正式发布 v1.0 [C#.NET Redis Client]

    最近很多 .net QQ 群无故被封停,特别是 wpf 群几乎全军覆没.依乐祝的 .net6交流群,晓晨的 .net跨平台交流群,导致很多码友流离失所无家可归,借此机会使用一次召唤术,有需要的请加群: ...

  2. 鏈接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] 解決 啟動 ...

  3. 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 ...

  4. Redis 5.0.0 releases notes

    Redis 5.0 release notes ======================= ---------------------------------------------------- ...

  5. Redis 3.0.0 正式版出炉,高性能 K/V 服务

    Redis 3.0.0 正式版最终到来了,与 RC6 版本号比較.该版本号改进包含: * 修复了无磁盘的复制问题 (Oran Agra) * 在角色变化后对 BLPOP 复制进行測试 (Salvato ...

  6. Redis(1.5)Redis配置文件(4.0.14)

    4.0.14 常用配置 bind 127.0.0.1 # 默认绑定本地,不写的话任何地址都可以访问 protected-mode yes #保护模式,如果没有设置bind 配置地址,也没有设置任何密码 ...

  7. Redis 3.0.0 集群部署

    简述: 1.0.1:redis cluster的现状 目前redis支持的cluster特性 1):节点自动发现 2):slave->master 选举,集群容错 3):Hot reshardi ...

  8. 高屋建瓴 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 ...

  9. 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 ...

随机推荐

  1. 使用A*寻路小记

    前几天做另一个DEMO 要用实现自动寻路功能,看到普遍都是A* 学习了下 我的主循环代码: isFindEndPoint = false; //主循环 do { CreateOutSkirtsNode ...

  2. tp5.0分页样式调控

    基础的分页调用 /** * 控制器部分代码 */ //实例化模型 $areasModel=new Areas(); //分页数据集 $listarea=$areasModel->paginate ...

  3. printFinal用法示例

    printFinal是一个基于jQuery的打印插件,支持打印预览,使用很简单,废话不多多说,直接上代码. <!DOCTYPE html PUBLIC "-//W3C//DTD XHT ...

  4. scp: /xxxx: not a regular file

    问题描述 scp root@10.2.1.92:/home /home/wangju/databakroot@10.2.1.92's password: xxxxscp: /home: not a r ...

  5. Oracle最大游标数控制

    /************************************************************************ ********* Oracle最大游标数控制 ** ...

  6. 史上最详细的CentOS 7 安装 HBase教程

    1. 前半部分参考 https://www.cnblogs.com/ivictor/p/5906433.html 2.问题 namenode无法启动,参考 https://stackoverflow. ...

  7. 弹层蒙版(mask),ios滚动穿透,我们项目的解决方案

    问题描述 项目开发遇到一个ios独有的问题,在wkwebview中稳定复现 问题: 弹出一个蒙版,当在蒙版上面滑动的时候蒙版后面的内容滚动了 这当然是ios的bug,但是经过我们测试iphone7也会 ...

  8. Django REST framework - 视图

    目录 Django REST framework 视图GenericAPIView GenericAPIView 例子 属性 混入 具体视图类 自定义基类 Django REST framework ...

  9. 3.1 一个简单的Java应用程序

        如下一个最简单的应用程序,它将只发送一条消息到控制台窗口中: package myjavapp;   public class FirstSample {       public stati ...

  10. 深入浅出了解HTTP协议

    深入浅出了解HTTP协议