However I just got hit by, key created between the 2 calls.
I did this for a number of keys, that were created in the same order, the 2 scripts got synchronized, and race condition appeared (not very often, only got hit by it once).
I'm not sure if we make available the etcd index of the response in the case of a 404 response; we should probably do that so that you can wait on the key from the index you got on your first request.
As I see it, there's no way of "get or wait for" key, in the read call.
you can do:
However I just got hit by, key created between the 2 calls. I did this for a number of keys, that were created in the same order, the 2 scripts got synchronized, and race condition appeared (not very often, only got hit by it once).