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

Fixed instancer loop logic that was causing Consul to get spammed #1215

Merged
merged 1 commit into from Mar 15, 2022

Conversation

jkratz55
Copy link
Contributor

Address issue #1214 - Instancer spamming Consul with requests

The instancer loop was never updating the lastIndex but passing it to getInstances which caused Instancer to spam Consul repeatedly and nearly killed our Consul agent pods and time instances were added or removed from Consul for that service.

@peterbourgon
Copy link
Member

Cool! Can you add a test which fails on the previous version and passes on this branch?

The instancer loop was never updating the lastIndex but passing it to getInstances which caused Instancer to spam Consul repeatedly and nearly killed our Consul agent pods and time instances were added or removed from Consul for that service.
@jkratz55
Copy link
Contributor Author

Hey @peterbourgon, I added a test case to the PR which fails on the old version and passes with the fix. Since the logic was in a loop that ran forever, the unit tests seem odd but seem to work. I'm just pumping out an error on a channel when the mock client detects the same index value was passed twice in a row and assumes every lookup Consul returns a new index since it isn't doing blocking queries in the mock.

@peterbourgon peterbourgon merged commit 0e6a1b1 into go-kit:master Mar 15, 2022
@peterbourgon
Copy link
Member

Thanks!

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