Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple values in x-consul-index for /v1/event/list requests (every other request..) #361

Closed
headconnect opened this issue Sep 23, 2014 · 0 comments

Comments

@headconnect
Copy link

Recently discovered that when using long-polling for the /v1/event/list api endpoint, the x-consul-index header will contain the old + new index:

  1. Make original request, index is passed as 0
http request made
/v1/event/list?wait=1m&index=0
STATUS: 200
HEADERS: {"content-type":"application/json","x-consul-index":"14626327808633989327","date":"Tue, 23 Sep 2014 20:19:46 GMT","transfer-encoding":"chunked"}
  1. now that we have the list of events, lets make the new request with long-polling to get some updates when things happen.. and once an event comes in:
making request with index: 14626327808633989327
http request made
/v1/event/list?wait=1m&index=14626327808633989327
STATUS: 200
HEADERS: {"content-type":"application/json","x-consul-index":"14626327808633989327, 12365592386954179651","date":"Tue, 23 Sep 2014 20:19:50 GMT","transfer-encoding":"chunked"}

So umm.. multiple x-consul-index values? I'll just use the second one since it seems to be the new one

  1. Making request with just second index:
making request with index: 12365592386954179651
http request made
/v1/event/list?wait=1m&index=12365592386954179651
STATUS: 200
HEADERS: {"content-type":"application/json","x-consul-index":"12365592386954179651","date":"Tue, 23 Sep 2014 20:20:50 GMT","transfer-encoding":"chunked"}

And everything seems fine with the x-consul-index once the message timed out after 1m (as set in the wait param).

If i get a new event during this time though, the x-consul-index is back to providing multiple values, i.e. 'old, new' instead of just 'new'.

Environment:
One single consul (0.4.0), running on windows, nodejs http client.
agent command:
consul agent -ui-dir web_ui\dist\ -server -bootstrap-expect 1 -data-dir tmp\consul\

@armon armon closed this as completed in 84649b5 Oct 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant