博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JDK NIO SelectionKey bug
阅读量:7015 次
发布时间:2019-06-28

本文共 614 字,大约阅读时间需要 2 分钟。

  hot3.png

此bug项目中使用elasticSearch中出现的,原因是,nio事件选择器,在特性内核下以及jdk6版本中,出现不hold线程,死循环获取事件的bug,导致cup使用率过高;

此bug在官网已被修复:http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6403933

 

如果不升级版本,

System.setProperty(“org.elasticsearch.common.netty.epollBugWorkaround”,true); 增加此句代码。

官网修复解决:取消了选择器,创建一个新的。

if (SelectionKey != null)  {  // the key you registered on the temporary selector   SelectionKey.cancel();   // cancel the SelectionKey that was registered with the temporary selector   // flush the cancelled key   temporarySelector.selectNow();} which is safe. Now everything works fine.

转载于:https://my.oschina.net/farces/blog/1585421

你可能感兴趣的文章
this的使用
查看>>
统计之 - 方差分析(ANOVA)
查看>>
MySQL参数优化及基础操作
查看>>
浏览器输入 \\192.168.0.1 和 192.168.0.1 的区别
查看>>
Javascript之【函数回调】
查看>>
linux 常用命令---hashlinux整理收集
查看>>
体系结构之4+1view
查看>>
Nginx的安装 Centos
查看>>
mybatis-generator配置
查看>>
Eclipse插件大全
查看>>
腾讯击败EA/暴雪 成全球第四大游戏公司
查看>>
学习笔记04.09
查看>>
用list 接 数值,再讲数值转成 整形数组,排序、再将相邻的数用范围形式表示、...
查看>>
《Android开发从零开始》——7.Intent初级学习
查看>>
Cacti weathermap添加实时读数节点
查看>>
Linux就该这么学
查看>>
Qmail 邮件系统维护管理技术文档
查看>>
Google Guava - Cache
查看>>
你以为的SPSS只是简单的数据分析软件吗?
查看>>
CSS Grid Simple Example
查看>>