This seems like fairly boilerplate code to make sure you don't encounter conflicts in the scheduler across various goroutines.<p>I'm curious how long the wait was as it had to be pretty serious to explicitly make the code thread <i>unsafe</i> to "fix" it.
Mesos is written in C++. Mesos upstream is also looking to entirely remove the Zookeeper dependency so blind Java / JVM hatred is kind of stupid. Mesos is battle tested in multi thousand node clusters.