summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-09-18 13:47:28 +0100
committerLibravatar GitHub <noreply@github.com>2023-09-18 13:47:28 +0100
commitc6fdcd52fabb6984de280f763ec5dc2023613054 (patch)
tree939de6cc265fb0c73ef40c2129c8eb298fd93b0c /vendor/google.golang.org/grpc/resolver_conn_wrapper.go
parent[chore]: Bump github.com/miekg/dns from 1.1.55 to 1.1.56 (#2204) (diff)
downloadgotosocial-c6fdcd52fabb6984de280f763ec5dc2023613054.tar.xz
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.17.0 to 1.18.0 (#2207)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/google.golang.org/grpc/resolver_conn_wrapper.go')
-rw-r--r--vendor/google.golang.org/grpc/resolver_conn_wrapper.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
index b408b3688..d68330560 100644
--- a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
+++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go
@@ -133,7 +133,7 @@ func (ccr *ccResolverWrapper) close() {
ccr.mu.Unlock()
// Give enqueued callbacks a chance to finish.
- <-ccr.serializer.Done
+ <-ccr.serializer.Done()
// Spawn a goroutine to close the resolver (since it may block trying to
// cleanup all allocated resources) and return early.
@@ -152,6 +152,14 @@ func (ccr *ccResolverWrapper) serializerScheduleLocked(f func(context.Context))
// which includes addresses and service config.
func (ccr *ccResolverWrapper) UpdateState(s resolver.State) error {
errCh := make(chan error, 1)
+ if s.Endpoints == nil {
+ s.Endpoints = make([]resolver.Endpoint, 0, len(s.Addresses))
+ for _, a := range s.Addresses {
+ ep := resolver.Endpoint{Addresses: []resolver.Address{a}, Attributes: a.BalancerAttributes}
+ ep.Addresses[0].BalancerAttributes = nil
+ s.Endpoints = append(s.Endpoints, ep)
+ }
+ }
ok := ccr.serializer.Schedule(func(context.Context) {
ccr.addChannelzTraceEvent(s)
ccr.curState = s