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

fix wait to use the correct wait index #8

Merged
merged 1 commit into from
May 8, 2015
Merged

fix wait to use the correct wait index #8

merged 1 commit into from
May 8, 2015

Conversation

defunctzombie
Copy link
Collaborator

Waiting on a key will fail if the wait index is too old. This happens
when waiting on a key that does not change a lot but other keys are
changing. Previous behavior would fail with an error which the caller
would have to handle. This commit internalizes the logic to this module.

Alternative approach is to document this error and make etcdjs.wait
callers handle it.

Waiting on a key will fail if the wait index is too old. This happens
when waiting on a key that does not change a lot but other keys are
changing. Previous behavior would fail with an error which the caller
would have to handle. This commit internalizes the logic to this module.

Alternative approach is to document this error and make etcdjs.wait
callers handle it.
@defunctzombie
Copy link
Collaborator Author

Technically this is only a "half-assed" solution. The more correct solution per the etcd docs (linked in the code comment) is to call a get after the wait to have a new value but that would maybe require calling the callback that is interested in the wait events in the first place with maybe an artificially created set event? Per this solution, events could be missed I think but it does fix up the error situation.

@mafintosh
Copy link
Owner

Talking on twitter just reminded me that I forgot about this issue. I'm fine with this change for now. Could you open an issue that document that we need to do the better solution at some point?

mafintosh added a commit that referenced this pull request May 8, 2015
fix wait to use the correct wait index
@mafintosh mafintosh merged commit 30a7757 into master May 8, 2015
@mafintosh
Copy link
Owner

2.3.0

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

Successfully merging this pull request may close these issues.

None yet

2 participants