Skip to content

Fix deprecated gRPC naming.Watcher #2015

@zendern

Description

@zendern

Found as part of #1912 where we fixed most of the linting issues. The only outstanding item is as follows and has been ignored for now by adding a //nolint:staticcheck

pkg/querier/frontend/worker.go:60:10: SA1019: naming.Watcher is deprecated: please use package resolver.  (staticcheck)
	watcher naming.Watcher

watcher naming.Watcher

This will have ripple effects that will go up into where we define the resolver

resolver, err := naming.NewDNSResolverWithFreq(cfg.DNSLookupDuration)
if err != nil {
return nil, err
}
watcher, err := resolver.Resolve(cfg.Address)
if err != nil {
return nil, err
}
ctx, cancel := context.WithCancel(context.Background())
w := &worker{
cfg: cfg,
log: log,
server: server,
ctx: ctx,
cancel: cancel,
watcher: watcher,
}

There is no direct Watcher class that exists in the resolver package referenced. So the migration is likely a little more in depth than just using resolver.Watcher or something similar.

Reference to that Watcher class
https://godoc.org/google.golang.org/grpc/naming#Watcher

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions