Spring 批处理 - 作业在 STARDED 状态下仍处于阻塞状态

问题描述

我有一个并行执行的单个块步骤的作业(8 个分区):

  • 阅读器:JdbcCursorItemReader
  • 处理器:使用 jdbcTemplate 调用数据库(每个分区 1 个线程)
  • Writer:写入文件

我使用 JdbcCursorItemReader 从共享 Postgres 数据库 (v9.2) 读取数百万条数据。(其他用户同时使用数据库

Spring 批处理版本:3.0.6

问题是作业和步骤在执行几个小时后在状态 STARTED 上被阻止,日志中有任何错误

被封锁前:

enter image description here

屏蔽

表 pg_stat_activity 为空(我认为处理器已被杀死)并且状态作业 = STARTED

enter image description here

enter image description here

有人知道为什么作业和并行步骤在 STARTED 状态被阻止吗?

感谢您的帮助

解决方法

作业配置 enter image description here

enter image description here

我的问题是为什么作业在状态为 STARTED 时被阻止,因为我在开始新的执行时遇到了一些问题