[SPARK-3571] Spark standalone cluster mode doesn't work.

I think, this issue is caused by #1106
Won't this result in an infinite loop if no workers are available? `curPos` is never equal to `aliveWorkerNum`