i found that zk.Connect return no error when zk server is error or down.
i don't know why? i think it should return error when service is unreachable or timeout.
`package main
import (
"fmt"
"time"
"github.com/samuel/go-zookeeper/zk"
)
func main() {
c, _, err := zk.Connect([]string{"127.0.0.1"}, time.Second) //*10)
if err != nil {
panic(err)
}
fmt.Printf("reach here. no error for zk.Connect! But there is no zk service running \n")
children, stat, ch, err := c.ChildrenW("/")
if err != nil {
panic(err)
}
fmt.Printf("%+v %+v\n", children, stat)
e := <-ch
fmt.Printf("%+v\n", e)
}`
i found that zk.Connect return no error when zk server is error or down. i don't know why? i think it should return error when service is unreachable or timeout. `package main
import ( "fmt" "time"
)
func main() { c, _, err := zk.Connect([]string{"127.0.0.1"}, time.Second) //*10) if err != nil { panic(err) } fmt.Printf("reach here. no error for zk.Connect! But there is no zk service running \n") children, stat, ch, err := c.ChildrenW("/") if err != nil { panic(err) } fmt.Printf("%+v %+v\n", children, stat) e := <-ch fmt.Printf("%+v\n", e) }`