Re: How to force-quit a Spark application?

You should check the active threads in your app. Since your pool uses
non-daemon threads, that will prevent the app from exiting.

spark.stop() should have stopped the Spark jobs in other threads, at
least. But if something is blocking one of those threads, or if
something is creating a non-daemon thread that stays alive somewhere,
you'll see that.

Re: How to force-quit a Spark application?

Hi Marcelo,

Thanks for your reply! It made sense to me. However, I've tried many ways to exit the spark (e.g., System.exit()), but failed. Is there an explicit way to shutdown all the alive threads in the spark application and then quit afterwards?

You should check the active threads in your app. Since your pool uses
non-daemon threads, that will prevent the app from exiting.

spark.stop() should have stopped the Spark jobs in other threads, at
least. But if something is blocking one of those threads, or if
something is creating a non-daemon thread that stays alive somewhere,
you'll see that.