LuciferYang opened a new pull request, #13098: URL: https://github.com/apache/gluten/pull/13098
## What changes are proposed in this pull request? When all configured Spark local directories are uncreatable at startup (disk full, read-only mounts, or a misconfigured `spark.local.dir`), `SparkDirectoryUtil.ROOTS` becomes 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`, and forcing that over an empty stream hangs at the `val cycleLooper` initializer, so the caller spins forever with no error. The random variant instead throws a `bound must be positive` `IllegalArgumentException` from `Random.nextInt(0)`. Neither points at the missing local directory. This adds an `isEmpty` guard in `namespace(...)` that throws early with a message naming the namespace and the configured directories, plus a matching guard in the `Namespace` constructor (before the eager `cycleLooper`) as a safety net. Two pre-existing guards that could never fire are removed: a `!hasNext` check on a non-empty infinite cycle, and an empty-path check that a resolved path never hits. ## How was this patch tested? New `SparkDirectoryUtilSuite`: one case asserts `namespace(...)` fails fast naming the configured dirs when none can be created (instead of hanging), one asserts the `Namespace` constructor rejects an empty parent list, and one asserts normal child-dir creation under an available root still works. ## Was this patch authored or co-authored using generative AI tooling? Yes. Generated-by: ZCode (GLM-5.3). Related issue: #13097. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
