Closed tsuraan closed 7 years ago
can this be reproduced with a test case?
I'm not sure how the zetcd unit tests work. Is it all in the integration directory? Anyhow, just connecting with a zookeeper client (zkCli would probably work, but I'm using the python kazoo library) and doing a get "/" currently crashes zetcd. It should be a pretty easy test, but I'm not sure where it should go.
Sometimes (such as when doing a get on /), the server's response won't have any Kvs in the second response. This causes zetcd to crash when a client does a get on /. I'm not certain this change is valid, but it does prevent the crash. It also gives some rather arbitrary looking data for the node's value, probably because it's using an arbitrary response instead of the hard-coded second response. Maybe we need to always use Responses[2], but if it has no Kvs, use an empty byte array instead of crashing?
If desired, I can make that change. I just don't want zetcd to crash quite so easily.