opened
spring-issuemaster
username_0
**[Matthew T. Adams](https://jira.spring.io/secure/ViewProfile.jspa?name=matthewadams)** opened **[BATCH-1740](https://jira.spring.io/browse/BATCH-1740?redirect=false)** and commented

If a process hosting a job dies unexpectedly or is killed (Ctrl-C, kill -9, etc), the job cannot be restarted, because Spring Batch is not aware that the process was killed.

Much like other software can detect whether it was shut down gracefully v. abruptly, Spring Batch should be enhanced to do so.  My guess would be to have Spring Batch update the JobRepository with a flag saying that a particular JobExecution was completed gracefully only upon normal exit (via -stop or end of flow).  Then, upon a restart attempt of the JobExecution, Spring Batch could detect whether or not the last JobExecution terminated ubruptly v. gracefully and restart appropriately.


---

**Affects:** 2.1.7

**Reference URL:** http://forum.springsource.org/showthread.php?t=108602

3 votes, 4 watchers
Detect killed batch process [BATCH-1740]
issue
created
benas
username_1
Closing this as duplicate of #1529 .
comment
closed
benas
username_1
issue