I have a long running Python 3.6 application that is hosting a PySpark 2.4.6 Session on YARN. I would like to be able to get notified/have a method called if the Spark Session crashes/dies, so that I can automatically restart it.
I'd like to do this proactively, rather than wrapping every call to the session and catching errors that the session is closed, and then making users wait while the session restarts.