see https://github.com/spring-projects/spring-boot/issues/41336

I have added logic to determine the application's state based on the job's status

Comment From: pivotal-cla

@diqksrk Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@diqksrk Thank you for signing the Contributor License Agreement!

Comment From: codespearhead

Does this patch intent to solve https://github.com/spring-projects/spring-boot/issues/41336 ?

If so, can you link this PR to that issue, so that issue is closed automatically when this PR is merged?

To do that, you just need to add the exact word combination in the PR description:

fix https://github.com/spring-projects/spring-boot/issues/41336

Comment From: scottfrederick

Thanks for trying to help @codespearhead, but the steps you mention are not necessary. When we're ready, we will manually close the issue as superseded by the PR, and we will ensure that the commit comments contain what's necessary to track back to the PR.

Comment From: wilkinsona

The changes proposed here shouldn't be necessary as JobExecutionExitCodeGenerator should produce an exit code based on the status of an jobs that have been executed:

https://github.com/spring-projects/spring-boot/blob/293739b9f0ff73eeea67657d1c8fa906ac5ba525/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobExecutionExitCodeGenerator.java#L41-L49

If you use SpringApplication.exit, as I linked to above, this exit code generator should be involved in deciding the JVM's exit code. I'm going to close this one as I don't think the changes are needed. If you're using System.exit and SpringApplication.exit and it isn't working as expected, a different change to the one proposed here will be needed to fix it. We can figure that out in #41336.