After the stages get cancelled, there are a bunch of calls back to the dag scheduler in the TaskSetManager (because in the normal case, we tell the DAGScheduler when all tasks end), so you're right that this seems potentially problematic.  @CodingCat what happens in this case (i.e., when the DAGScheduler loop gets more events, after it has been stopped)?