Setting application FAILED exit status Spring Boot Yarn

Let’s say we need to terminate Spring Boot Yarn application due to checked exception. To do this, in the AppMaster class (it must be specified in the appmaster-class property in application.yml) we need to call the method in the place we need:

super.setFinalApplicationStatus(FinalApplicationStatus.FAILED);

If you need to stop the application from outside the AppMaster class, you can make a method:

public void killApplicationWithFailedStatus() {
  super.setFinalApplicationStatus(FinalApplicationStatus.FAILED)
  super.doStop();
}
Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at promark33@gmail.com.

If I saved your day, you can support me 🤝

Leave a Reply

Your email address will not be published. Required fields are marked *