/**
* Fixes the thread deadlock issue in {@link org.apache.spark.SparkContext#stop} where the {@link Selector} field
* in {@link ConnectionManager} waits for an interrupt.
*/
private static void sparkContextStopBugFixer() {
ConnectionManager connectionManager = getConnectionManager(getSparkContext());
if (!closeSelector(connectionManager)) {
LOG.warn("Failed to get the Selector which can cause thread deadlock in SparkContext.stop()");
}
}