Another case here is rdd.union(rdd)... I'm not sure what the semantics are of that, but someone might be using it somewhere. The better behavior might be to actually just gracefully runcate the search if a cycle is found.