Ignoring lots of polling, inefficiencies, early defensive raw sleeps, various races and bugs and a laundry list of items involved in making leader processes good enough to enter a collection creation contest, here is a more practical small set of notes off the top of my head on a quick inspection around what is currently just in your face non sensible.
https://gist.github.com/markrmiller/233119ba84ce39d39960de0f35e79fc9
