scala - ChannelClosedException - 上游地址:不可用
问题描述
我们的 scala/thrift 服务正在使用带有 java8 的 twitter finagle 2.12-18.10.0。该服务对于单个请求或少数请求运行良好,但是当我们尝试用很多请求访问该服务时,我们会收到很多请求
'com.twitter.finagle.ChannelClosedException: ChannelException at remote address: hostname:9091 from service: calcservice-thrift. Remote Info: Upstream Address: Not Available, Upstream id: Not Available,
at org.apache.thrift.TApplicationException.readFrom(TApplicationException.java:131)
命中服务器的示例客户端(间歇性失败)
log.info("started");
IntStream.range(0,500)
.parallel()
.forEach(i->{
try {
//remote call to finagle service
}
catch(Exception e){
log.error("error " ,e);
}
});
log.info("end");
为什么服务器会随机关闭频道。可能的解决方法是什么
解决方案
推荐阅读
- java - 为 HtmlUnit 构建正确的 xpath
- c++ - QString 的 QList 如何分配给列表视图?
- json - 解组 JSON 不打印 stuct 中的值
- java - 属性 [project] 标有矛盾的注释
- r - dplyr:在 for 循环中获取分组的最小和最大列
- python - 在 Django Model 数据库函数中使用 Unaccent
- java - 我无法使用 Selenium 启动浏览器
- python - 按值而不是引用在列表中分配值
- smtp - 为什么即使在配置 SMTP 之后 prestashop 电子邮件也无法正常工作?
- algorithm - 从给定数字中获取所有可能的操作组合的算法