Flink问题排查-Buffer pool is destroyed.

近期Flink 作业偶发报错:java.lang.IllegalStateException: Buffer pool is destroyed.
通过GOOGLE和百度查询结果有:
1、jdk问题:发送数据源方jdk版本高于Flink使用方,需要提高jdk版本解决
2、数据源问题(某个数据源为空),由于这个报错往往与"Could not forward element to next operator"同时存在,很可能会考虑到数据源问题上去,毕竟数据解析失败、使用EventTimeWindows拿不到事件事件时都会爆出这个错误。

     通过排查,这两种方式都不适合我的情况,只好拿到数据问题进行debug,本地IDEA启动Flink后,发现也是偶发报错,无法直接复现,摸不到规律。

      因为我的Flink开启了Checkpoint,本地运行时,hdfs地址不存在导致checkpoint失败:

Flink问题排查-Buffer pool is destroyed.

checkpoint失败

 于是,关闭checkpoint,仅仅是为了避免大量报错日志:

//env.enableCheckpointing(1200000L);

却有惊喜发现,Buffer pool is destroyed.报错消失了,严重怀疑跟checkpoint有关系,于是赶紧到线上的Flink 控制台查看JOB Manager 的logs:

 

Flink问题排查-Buffer pool is destroyed.

发现第133次checkpoint失败,原因是:
      org.apache.flink.runtime.executiongraph.ExecutionGraph - Window(TumblingEventTimeWindows(120000), EventTimeTrigger, ImpRequestFunc, PassThroughWindowFunction) -> Sink: Unnamed (24/36) (f43062b98a5f227294dfbc62d2f77b28) switched from RUNNING to FAILED.:java.util.concurrent.TimeoutException: The heartbeat of TaskManager with id container_1586184618073_19932_01_000002  timed out.


 

Flink问题排查-Buffer pool is destroyed.

Flink作业尝试重启fail job

Flink问题排查-Buffer pool is destroyed.

再通过作业错误日志看到Buffer pool is destroyed的报错时间与上面的报错时间吻合,于是确定是此原因。

未完待续。。