koding / kite

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

kontrol: re-add when update fails #139

Closed mischief closed 9 years ago

mischief commented 9 years ago

when the ttl expires, update will no longer work due to etcd returning a key not found error. try to add the kite again, which gets things working again. without this, kite keeps retrying and failing forever, and the service needs to be restarted for it to work.

cihangir commented 9 years ago

Thanks @mischief

fatih commented 9 years ago

@mischief thanks for the PR. I'll going to look at it, even though it's a small change I just want to check if everything is ok. I had other things to do recently, sorry for the delay.

mischief commented 9 years ago

@fatih it is a strange situation - the only way i could cause it to happen was running etcd/kontrol in a CoreOS vm in qemu on my laptop. when i would put the laptop to sleep and wake it up later, time would jump forward and cause expiry of kontrol key's ttl, so update would not work any more. it might be a rare situation in practice, but pretty annoying for development :p

mischief commented 9 years ago

@fatih friendly ping :-)

fatih commented 9 years ago

@mischief I'll look at it today! I was on vacation so sorry.

fatih commented 9 years ago

This looks good, I'm now testing it on our internal code base (We have a lot of integration tests for it). If everything is good I'll merge it :)