koding / kite

Micro-service framework in Go
https://godoc.org/github.com/koding/kite
MIT License
3.26k stars 300 forks source link

TMS-2624 tokenrenewer: add 2 defensive checks #151

Closed rjeczalik closed 8 years ago

rjeczalik commented 8 years ago

tokenrenewer was reported to panic while handling disconnect signal with the following stacktrace:

panic: close of closed channel

goroutine 282305 [running]: github.com/koding/kite.func·034() github.com/koding/kite/tokenrenewer.go:64 +0x2e github.com/koding/kite.func·006() github.com/koding/kite/client.go:498 +0x4f github.com/koding/kite.(_Client).callOnDisconnectHandlers(0xc20aaf9a40) github.com/koding/kite/client.go:499 +0xdc github.com/koding/kite.(_Client).run(0xc20aaf9a40) github.com/koding/kite/client.go:290 +0x13a created by github.com/koding/kite.(*Client).dialForever github.com/koding/kite/client.go:255 +0xc1

This PR:

sent-hil commented 8 years ago

LGTM...tests are failing though.

cihangir commented 8 years ago

go get fails https://travis-ci.org/koding/kite/jobs/118852542#L257

rjeczalik commented 8 years ago

@sent-hil: fixed the race that caused that failure, rest was failing due to:

@cihangir: coreos/etcd switched 6 days ago from godeps to vendor, thus builds on 1.4 were failing, I've pinned etcd to latest stable release

cihangir commented 8 years ago

Looks good to me :+1: