If we agree that it's bad to have two RMs accidentally sharing the same state store,
If it's in non-HA mode, currently there's no protection in the ZKStore preventing two RMs from sharing the same store. All the ACLs setting related code is only used in HA mode. Essentially, with current patch, I doubt it will get NoAuthException in the verifyThread, without making user change the ACLs manually. So the handling code in this patch will not be triggered with default setting. Maybe I'm wrong, you may try on a real cluster.. also, I thinking setting ACLs for RM is not a required step for deploying non-HA cluster, forcing this to be set is behavior change..
why would you not want to catch the issue as early as possible?
My point is that first,will this code work as mentioned above. second, if there's no difference in terms of functionality, why do I need to start a thread pinging the zk continuously every few seconds. Of course, I might miss something, you may clarify more...
Also, is the use-case mainly about two clusters sharing the same zk-store with the same path ? IMHO, this is not a primary use-case to solve, if user mis-configured, it's user's fault. There are many other places that can go wrong. e.g. if two clusters configure the same path for anything on HDFS.
If the use-case is about two RMs sharing the same zk-path in the same cluster with non-HA mode. I think in non-HA mode, the invalid RM will not take workload in the first place, clients, NMs will not switch to that RM if HA is not configured properly.