Does anyone know what the expected behavior is for blocking queries against non-extant keys? I see that when an GET request is made for a key that doesn’t exist the result is a 404, but an X-CONSUL-INDEX header is returned.
Intuitively I would expect that if I make a blocking query with the returned index the request would block until either the key existed or the wait time expired (presumably returning another 404 with the same index). However, what I observe is when I issue a request with the ?index parameter for a non-extant key the 404 is returned immediately with a new index header.
I suppose it makes sense since a missing key has no “state” in which an index can be stored. In whatever case, is there any way to make blocking queries against keys that don’t exist? I’m trying to avoid spamming requests. My current solution is to sleep on a 404, but that means that if the key is created I’m stuck waiting the full sleep before detecting it.