Given all the magic happens here, I can see this lots of eyes finding their way to this `while` loop; it would be nice to document the expected behavior.

Also, there was a deadlocking happening with one of the goroutines in this loop, right? Did you find out why that was happening? Would be personally useful to help avoid running into unexpected deadlocks.