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

watch: Disable monotonicity check for lastIndex when type is "event" #3625

Closed

Conversation

yunazuno
Copy link

In Consul v0.8.4 or later, consul watch -type event child invokes a child process several time with the same events, which is unexpected.
Description: https://gist.github.com/yunazuno/798372ec53b01cf36e7ef00b691ba3ae

This problem is possibly caused by a monotonicity check for p.lastIndex in watch/plan.go.
Unlike the other watch types, "event" doesn't have monotonic index. Therefore, the monotonicity check sometime unexpectedly resets p.lastIndex.

This PR disables the monotonicity check when type of a watch is "event" in order to prevent the issue.

Since lastIndex is not monotonic when type of a watch is "event", we have to
disable the monotonicity check for the "event."
@yunazuno
Copy link
Author

yunazuno commented Nov 3, 2017

Hi @slackpad,
The original logic was introduced in d7b5f41 as part of #2621. Would you please take a look?

@yunazuno
Copy link
Author

Hi @slackpad, sorry to bother you. Do you have any news on this PR?

@yunazuno
Copy link
Author

I found that the same issue is also reported in #3443.
Due to this bug, watch for custom events (consul watch -type event command for example) is not working since v0.8.4.
I'd really appreciate it if you all could take a look this issue to fix the bug.

@slackpad
Copy link
Contributor

Linking to #3742.

@hanshasselberg
Copy link
Member

This should have been fixed by #3742.

@ghost
Copy link

ghost commented Jan 25, 2020

Hey there,

This issue has been automatically locked because it is closed and there hasn't been any activity for at least 30 days.

If you are still experiencing problems, or still have questions, feel free to open a new one 👍.

@ghost ghost locked and limited conversation to collaborators Jan 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants