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 ...
随机推荐
- Elasticsearch之Hadoop插件的安装(图文详解)
这个Hadoop插件的安装是非常重要. Hadoop插件安装 在es的安装目录下 bin/plugin install elasticsearch/elasticsearch-repository-h ...
- 如何下载 Nginx (windows 版本)并且简单的使用
官网地址:http://nginx.org/ 进到官网 我这里下载的是 稳定版的 windows版本. 开始我们的简单测试 步骤一:找到nginx的压缩包,(随意找个地方)解压 步骤二:进入conf文 ...
- debounce还是throttle(去抖和节流)
debounce 去抖 我的理解很简单,比方说window.onscroll会疯狂触发handler,此时给它一个debounce(handler, delayTime). 就是不管你延时时间内触发了 ...
- 如何卸载系统自带的Microsoft Office
(1)首先.在C盘删除office文件夹. (2)删除注册表 1)开始菜单-->运行-->regedit进入注册表 (window+r -->) 2)在注册表里找到HKEY_CUR ...
- mysql中返回当前时间的函数或者常量
引用:http://blog.sina.com.cn/s/blog_6d39dc6f0100m7eo.html 1.1 获得当前日期+时间(date + time)函数:now() 除了 now() ...
- 扩增子图表解读1箱线图:Alpha多样性
箱线图 箱形图(Box-plot)又称为盒须图.盒式图或箱线图,是一种用作显示一组数据分散情况资料的统计图.因形状如箱子而得名.在宏基因组领域,常用于展示样品组中各样品Alpha多样性的分布 第一种情 ...
- xadmin站点管理类
9. Xadmin xadmin是Django的第三方扩展,比使用Django的admin站点更强大也更方便. 文档:https://xadmin.readthedocs.io/en/latest/i ...
- demo记录
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http ...
- 零基础学习Python培训,应该选择哪个培训班?
近几年中,Python一直是市场上最受欢迎的编程语言之一.它语法自然,入门简单,同时应用范围又极广,无论是大火的人工智能.大数据还是传统的web开发.自动化运维,Python都能够大展拳脚.根据职友集 ...
- ASP.NET Log4Net日志的配置及使用,文件写入
Log4net是Apache log4j框架在Microsort.NET平台实现的框架. 帮助程序员将日志信息输出到各种目标(控制台,数据库,文件等) 1.新建一个ASP.NET项目 2.新建一个 l ...