samuel/go-zookeeper — pull request #43 by wy96f (2014-12-16 05:57:49+00:00)
Title: flush unsent request if err happens and set read timeout on prime conn...

In our case, the client can't initialize session on prime connection bcs the zookeeper server shuts down. It stays for some time leading to lots of "sendSetWatches" goroutines which occupy too much memory. We should also flush unsent requests to avoid oom whenever errors happen.
Occasionally the client blocks in reading connection response. We should add read timeout for reading response.