Flink akka AskTimeoutException问题排查
最近遇到一个很奇怪的问题,Flink任务正常启动正常运行一段时间后就会报错,,错误详情如下
2019-12-11 17:20:57.757 flink [flink-scheduler-1] ERROR o.apache.flink.runtime.rest.handler.job.JobsOverviewHandler - Unhandled exception.akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://flink/user/dispatcher#761962841]] after [10000 ms]. Sender[null] sent message of type "org.apache.flink.runtime.rpc.messages.LocalFencedMessage".
at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:604)
at akka.actor.Scheduler$$anon$4.run(Scheduler.scala:126)
at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:601)
at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:109)
at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:599)
at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(LightArrayRevolverScheduler.scala:329)
at akka.actor.LightArrayRevolverScheduler$$anon$4.executeBucket$1(LightArrayRevolverScheduler.scala:280)
at akka.actor.LightArrayRevolverScheduler$$anon$4.nextTick(LightArrayRevolverScheduler.scala:284)
at akka.actor.LightArrayRevolverScheduler$$anon$4.run(LightArrayRevolverScheduler.scala:236)
at java.lang.Thread.run(Thread.java:745)
初步判断应该是触发了akka的超时机制,那就先调整集群的akka超时间配置,在conf/flink-conf.yaml最后增加下面参数
akka.ask.timeout: 100 s
观察Job Manager Configuration,配置参数已经生效

再将任务起起来,在运行十几个小时之后还是出现同样的错误,这就很奇怪了,明明更改了参数也生效了,为啥还是10000 ms就超时了

似乎有点邪门,只能Google一把了,在Apache Flink 中文用户邮件列表找到类似的问题,给出的建议是调整akka.ask.timeout和web.timeout两个参数
异常原因如上所说是 akka ask timeout 的问题,这个问题前两天有人在部署 k8s 的时候也遇过[1] 他的情况是配置资源过少导致 JM 未能及时响应。除了调整上述参数外也可看看是不是这个问题。 Best,
tison. [1]
https://lists.apache.org/thread.html/84db9dca2e990dd0ebc30aa35390ac75a0e9c7cbfcdbc2029986d4d7@%3Cuser-zh.flink.apache.org%3E Biao Liu <[hidden email]> 于2019年8月8日周四 下午8:00写道: > 你好,
>
> 异常里可以看出 AskTimeoutException, 可以调整两个参数 akka.ask.timeout 和 web.timeout
> 再试一下,默认值如下
>
> akka.ask.timeout: 10 s
> web.timeout: 10000
>
> PS: 搜 “AskTimeoutException Flink” 可以搜到很多相关答案
>
> Thanks,
> Biao /'bɪ.aʊ/
这我就有点奇怪了,错误和web.timeout有啥关系啊,只能顺着错误翻看Flink源码了。在源码重直接找到JobsOverviewHandler类,发现引用这个类就两个:一个是JobsOverviewHeaders,主要是作为一个link;另外一个是WebMonitorEndpoint,
在这实例化了一个JobsOverviewHandler,传入了timeout参数
protected final RestHandlerConfiguration restConfiguration;
final Time timeout = restConfiguration.getTimeout();
JobsOverviewHandler jobsOverviewHandler = new JobsOverviewHandler(leaderRetriever,timeout,responseHeaders,JobsOverviewHeaders.getInstance());
再追踪timeout来源发现取自RestHandlerConfiguration Timeout字段,而这个值来自WebOptions.TIMEOUT
public static RestHandlerConfiguration fromConfiguration(Configuration configuration) {
final long refreshInterval = configuration.getLong(WebOptions.REFRESH_INTERVAL);
final int maxCheckpointStatisticCacheEntries = configuration.getInteger(WebOptions.CHECKPOINTS_HISTORY_SIZE);
final Time timeout = Time.milliseconds(configuration.getLong(WebOptions.TIMEOUT));
final String rootDir = "flink-web-ui";
final File webUiDir = new File(configuration.getString(WebOptions.TMP_DIR), rootDir);
return new RestHandlerConfiguration(
refreshInterval,
maxCheckpointStatisticCacheEntries,
timeout,
webUiDir);
}
/**
* Timeout for asynchronous operations by the web monitor in milliseconds.
*/
public static final ConfigOption<Long> TIMEOUT =
key("web.timeout")
.defaultValue(10L * 1000L)
.withDescription("Timeout for asynchronous operations by the web monitor in milliseconds.");
这下真相大白,果然需要调整web.timeout参数,是web监视器的异步操作超时时间,默认10000ms。将该值提高到300000ms,继续观察。
参考
https://zhuanlan.zhihu.com/p/49095640
http://apache-flink.147419.n8.nabble.com/Fwd-need-help-td321.html#a349

Flink akka AskTimeoutException问题排查的更多相关文章
- 记录一次Flink作业异常的排查过程
最近2周开始接手apache flink全链路监控数据的作业,包括指标统计,业务规则匹配等逻辑,计算结果实时写入elasticsearch. 昨天遇到生产环境有作业无法正常重启的问题,我负责对这个问题 ...
- Flink on YARN(下):常见问题与排查思路
Flink 支持 Standalone 独立部署和 YARN.Kubernetes.Mesos 等集群部署模式,其中 YARN 集群部署模式在国内的应用越来越广泛.Flink 社区将推出 Flink ...
- Flink run提交参数
折腾了好几天,终于搞定了Flink run提交参数,记录一下. 背景: 之前一直报错,akka,AskTimeoutException,尝试添加akka.ask.timeout=120000s, 依然 ...
- Flink源码分析
http://vinoyang.com/ http://wuchong.me Apache Flink源码解析之stream-source https://yq.aliyun.com/articles ...
- Flink articles
http://ictlabs-summer-school.sics.se/2015/slides/flink-advanced.pdf http://henning.kropponline.de/20 ...
- flink clickhouse-jdbc和flink-connector 写入数据到clickhouse因为jar包冲突导致的60 seconds.Please check if the requested resources are available in the YARN cluster和Could not resolve ResourceManager address akka报错血案
一.问题现象,使用flink on yarn 模式,写入数据到clickhouse,但是在yarn 集群充足的情况下一直报:Deployment took more than 60 seconds. ...
- 报错:Flink Could not resolve substitution to a value: ${akka.stream.materializer}
报错现象: Exception in thread "main" com.typesafe.config.ConfigException$UnresolvedSubstitutio ...
- Flink Checkpoint 问题排查实用指南
在 Flink 中,状态可靠性保证由 Checkpoint 支持,当作业出现 failover 的情况下,Flink 会从最近成功的 Checkpoint 恢复.在实际情况中,我们可能会遇到 Chec ...
- flink RPC(akka)
flink中的rpc框架使用的akka.在本节并不详细讲述akka,而是就flink中rpc来讲述akka的部分内容.本节,我从AkkaRpcActor.handleRpcInvocation方法讲起 ...
- 深入理解Akka Actor模型
Carl Hewitt 在1973年对Actor模型进行了如下定义:"Actor模型是一个把'Actor'作为并发计算的通用原语". Actor是异步驱动,可以并行和分布式部署及运 ...
随机推荐
- 提高NTC测温精度(转发)
(一)一般精度要求:采样数据的获取,直接采用恒流源(或恒压源)上拉方式.见图(2)所示. 原理:将恒流源(或恒压源)直接作用于NTC热敏电阻Rt上,当被测对象的温度发生变化,NTC热敏电阻的阻值Rt ...
- 【QT+MSVC2015】不安装VS2015,QT配置MSVC2015编译环境
本文介绍不安装VS2015的情况下在QT5.10中配置MSVC2015编译器. 系统:windows系统 QT版本:5.10.1 所需文件: QT安装程序--qt-opensource-windows ...
- 【根文件系统 】开发板通过nfs挂载ubuntu上的根文件系统
在此基础上制作可用的根文件系统:https://www.cnblogs.com/hengqiu/p/15908597.html 1.ubuntu搭建nfs服务器 sudo apt-get instal ...
- (0807) import 与 include文件
1)验证中filelist以及package https://blog.csdn.net/geter_CS/article/details/125689476 总结来说:规则是,要想使用某个文件内容, ...
- 403 forbidden 与 413Too Large
http://www.ccschy.com/shuma/12846.html https://blog.51cto.com/u_15127556/4543159 查的有关资料如下,最后的原因是服务器网 ...
- sdio 移植st官方例程 stm32f103
第一步:建立驱动文件 建立sdio_sdcard.h和sdio_sdcard.c,并将这两个文件添加到MDK工程中,如下图 第二步:移植官方例程 1.找到STM32F10x_StdPeriph_Lib ...
- [canvas]ncaught TypeError: Cannot read properties of null (reading 'getContext')
相信你和我一样是直接复制大佬的js代码(笑) ------------ 主要问题在于:js先加载完了,html才加载,导致js获取不了html的对象 解决办法: 把 <head /> ...
- SQL server数据库 账户SA登录失败,提示错误:18456
在我们使用数据库的时候,偶尔会遇到一些登录上的错误提示.比如,在数据库配置上没有正确开启用户的登录策略以及服务器身份验证模式时,就会提示"用户'sa'登录失败.(Microsoft SQL ...
- celery学习
1.清空队列:celery -A 项目名称 purge 2.原理参考 https://www.cnblogs.com/sui776265233/p/10004679.html 消息中间件(messa ...
- #maxlength vs #size form api reference
#maxlength Used by: password, textfield Description: The maximum amount of characters to accept as i ...