I think that there are probably race conditions in this code.  I can't see what happens in init(), but I believe that if there are worker nodes coming up and down (due to a temporary network partition or something where they are actually doing work), this could possibly see only a subset of the actual nodes that are up.

It seems like just setting something up that would be completely reactive to the existence of things on ZK would be less error-prone, is there a reason we cannot do that (or is there a reason I'm not thinking of that means that we don't actually care about this case?)