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

discovery.Manager.runUpdater() only needs to run once #4470

Closed
rainpavilion opened this Issue Aug 7, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@rainpavilion
Copy link

rainpavilion commented Aug 7, 2018

A provider runs runUpdater(),but they do same things, it maybe a bug.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Aug 7, 2018

Ah, you might have spotted "interesting"... I agree that a new runUpdater() goroutine is spawned for every SD provider while only one instance is needed AFAICT. This could explain SD issues like #4124.

func (m *Manager) startProvider(ctx context.Context, poolKey poolKey, worker Discoverer) {
ctx, cancel := context.WithCancel(ctx)
updates := make(chan []*targetgroup.Group)
m.discoverCancel = append(m.discoverCancel, cancel)
go worker.Run(ctx, updates)
go m.runProvider(ctx, poolKey, updates)
go m.runUpdater(ctx)
}

@krasi-georgiev?

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Aug 7, 2018

yes we only need one runUpdater so the logic can be improved there.
We added this just to throttle the updates to no more than one per 5 * time.Second.
The only side effect of the current code is that it will run the updates more often than desired, but shouldn't cause missing updates as in #4124.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.