描写叙述:

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. EF 新增数据时提示it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element

    it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionM ...

  2. 从如何停掉 Promise 链说起

    在使用Promise处理一些复杂逻辑的过程中,我们有时候会想要在发生某种错误后就停止执行Promise链后面所有的代码. 然而Promise本身并没有提供这样的功能,一个操作,要么成功,要么失败,要么 ...

  3. Java 开源博客 Solo 1.3.0 发布 - Docker 支持

    Solo 1.3.0 正式发布了,感谢一直以来关注 B3log 开源的朋友! 可以通过一个命令启动(不需要安装数据库.部署容器),也可以通过 war 方式部署容器,连接 MySQL.这应该是史上最容易 ...

  4. JS——stye属性

    1.样式少的时候使用 this.parentNode.style.backgroundColor="yellow"; 2.style是对象 console.log(box.styl ...

  5. [Windows Server 2012] 手工创建安全网站

    ★ 欢迎来到[护卫神·V课堂],网站地址:http://v.huweishen.com★ 护卫神·V课堂 是护卫神旗下专业提供服务器教学视频的网站,每周更新视频.★ 本节我们将带领大家:手工创建安全站 ...

  6. (转)Java任务调度框架Quartz入门教程指南(三)任务调度框架Quartz实例详解深入理解Scheduler,Job,Trigger,JobDetail

    http://blog.csdn.net/zixiao217/article/details/53053598 首先给一个简明扼要的理解: Scheduler 调度程序-任务执行计划表,只有安排进执行 ...

  7. ECharts实例开发学习笔记二——时间轴

    记录一下ECharts时间轴的使用,首先是照着官方的示例做一遍,在这里不要忘了引入timelineOption.js,后面介绍如何动态创建时间轴的记录数,即根据需求可伸缩显示有多少天或者年月等轴标记数 ...

  8. (转)Struts2访问Servlet的API及......

    http://blog.csdn.net/yerenyuan_pku/article/details/67315598 Struts2访问Servlet的API 前面已经对Struts2的流程已经执行 ...

  9. Ubuntu 18.04 安装chrome浏览器

    参考 https://blog.csdn.net/cyem1/article/details/86297197 一分钟安装教程! 1.将下载源加入到系统的源列表(添加依赖) sudo wget htt ...

  10. ubuntu 更改终端颜色

    1.$ sudo gedit .bashrc 2.PS1="\[\033[1;36;01m\]\u\[\033[00m\]\[\033[1;34;01m\]@\[\033[00m\]\[\0 ...