spark icon indicating copy to clipboard operation
spark copied to clipboard

[SPARK-40428][CORE][WIP] Fix shutdown hook in the CoarseGrainedSchedulerBackend

Open holdenk opened this issue 2 years ago • 3 comments

What changes were proposed in this pull request?

Fix the shutdown hook call through to CoarseGrainedSchedulerBackend

Why are the changes needed?

Sometimes if the driver shuts down abnormally resources may be left dangling.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests.

holdenk avatar Sep 14 '22 18:09 holdenk

SparkContext.stop will take care of this - and that is invoked from a shutdown hook already.

SparkContext.stop -> _dagScheduler.stop -> taskScheduler.stop -> backend.stop

mridulm avatar Sep 15 '22 04:09 mridulm

hmm for whatever reason that doesn't seem to be triggering for me, let me take a look through and see where things might be getting lost in that call path @mridulm

holdenk avatar Sep 15 '22 18:09 holdenk

Looks good to me - modulo @dongjoon-hyun's comment. We might want to also wrap FallbackStorage.cleanUp in SparkContext.stop. It is not strictly required for ensuring this specific codepath goes through, but will help ensure stop goes through completely.

mridulm avatar Sep 18 '22 17:09 mridulm

Merged to current dev :)

holdenk avatar Oct 05 '22 00:10 holdenk