It will exit fine because I configured the Timer object to use a daemon thread (see line 12 below). I also tested it, just to be sure, and the program exited without calling SparkContext.stop()