go-zookeeper icon indicating copy to clipboard operation
go-zookeeper copied to clipboard

conn.Close is not Idempotent

Open ganesh-karthick opened this issue 8 years ago • 1 comments

API conn.Close() Calling conn.Close on already closed connection causes program to panic, It would be good, if the call is made idempotent.

goroutine 8 [running]:
panic(0x576420, 0xc420252880)
	Documents/devtools/go/src/runtime/panic.go:500 +0x1a1
/github.com/samuel/go-zookeeper/zk.(*Conn).Close(0xc4203ea000)
	/home/Documents/git/goworkspace/src/github.com/samuel/go-zookeeper/zk/conn.go:253 +0x47

ganesh-karthick avatar Nov 18 '16 00:11 ganesh-karthick

any update on this? conn.Close() is not atomic even though most of APIs are goroutine safe.

mattn avatar Jul 03 '17 09:07 mattn