LPS-49993 ClassCastException on shutdown when scheduler is disabled