When every configured Spark local directory is uncreatable at startup (disk full, read-only mounts, or a spark.local.dir pointed at a file or a non-creatable path), SparkDirectoryUtil.ROOTS ends up empty, because the constructor logs and skips each directory whose creation throws.
The first namespace(...).mkChildDirRoundRobin(...) then constructs a Namespace whose cycleLooper is Stream.continually(ROOTS).flatten. Forcing that stream over an empty ROOTS hangs at the val cycleLooper initializer, so the caller spins forever with no error. The random variant (mkChildDirRandomly) instead throws IllegalArgumentException: bound must be positive from Random.nextInt(0). Neither points at the real cause, and the round-robin hang is silent (needs a jstack to diagnose).
Reachable in a degraded environment where the job cannot succeed anyway, so the value is failing fast with a clear message instead of hanging or crashing obscurely. Consumers on this path include spill-dir creation (VeloxIteratorApi/BoltIteratorApi), the JNI workspace (VeloxListenerApi), and shuffle-write dirs (ColumnarShuffleWriter).
When every configured Spark local directory is uncreatable at startup (disk full, read-only mounts, or a
spark.local.dirpointed at a file or a non-creatable path),SparkDirectoryUtil.ROOTSends up empty, because the constructor logs and skips each directory whose creation throws.The first
namespace(...).mkChildDirRoundRobin(...)then constructs aNamespacewhosecycleLooperisStream.continually(ROOTS).flatten. Forcing that stream over an emptyROOTShangs at theval cycleLooperinitializer, so the caller spins forever with no error. The random variant (mkChildDirRandomly) instead throwsIllegalArgumentException: bound must be positivefromRandom.nextInt(0). Neither points at the real cause, and the round-robin hang is silent (needs a jstack to diagnose).Reachable in a degraded environment where the job cannot succeed anyway, so the value is failing fast with a clear message instead of hanging or crashing obscurely. Consumers on this path include spill-dir creation (
VeloxIteratorApi/BoltIteratorApi), the JNI workspace (VeloxListenerApi), and shuffle-write dirs (ColumnarShuffleWriter).