[VOL-4290] Voltha go library updates for gRPC migration
Change-Id: I1aa2774beb6b7ed7419bc45aeb53fcae8a8ecda0
diff --git a/vendor/google.golang.org/grpc/health/client.go b/vendor/google.golang.org/grpc/health/client.go
index b43746e..419f060 100644
--- a/vendor/google.golang.org/grpc/health/client.go
+++ b/vendor/google.golang.org/grpc/health/client.go
@@ -33,20 +33,20 @@
"google.golang.org/grpc/status"
)
-const maxDelay = 120 * time.Second
-
-var backoffStrategy = backoff.Exponential{MaxDelay: maxDelay}
-var backoffFunc = func(ctx context.Context, retries int) bool {
- d := backoffStrategy.Backoff(retries)
- timer := time.NewTimer(d)
- select {
- case <-timer.C:
- return true
- case <-ctx.Done():
- timer.Stop()
- return false
+var (
+ backoffStrategy = backoff.DefaultExponential
+ backoffFunc = func(ctx context.Context, retries int) bool {
+ d := backoffStrategy.Backoff(retries)
+ timer := time.NewTimer(d)
+ select {
+ case <-timer.C:
+ return true
+ case <-ctx.Done():
+ timer.Stop()
+ return false
+ }
}
-}
+)
func init() {
internal.HealthCheckFunc = clientHealthCheck
@@ -105,7 +105,7 @@
continue retryConnection
}
- // As a message has been received, removes the need for backoff for the next retry by reseting the try count.
+ // As a message has been received, removes the need for backoff for the next retry by resetting the try count.
tryCnt = 0
if resp.Status == healthpb.HealthCheckResponse_SERVING {
setConnectivityState(connectivity.Ready)
diff --git a/vendor/google.golang.org/grpc/health/server.go b/vendor/google.golang.org/grpc/health/server.go
index c79f9d2..2262607 100644
--- a/vendor/google.golang.org/grpc/health/server.go
+++ b/vendor/google.golang.org/grpc/health/server.go
@@ -35,7 +35,7 @@
// Server implements `service Health`.
type Server struct {
- mu sync.Mutex
+ mu sync.RWMutex
// If shutdown is true, it's expected all serving status is NOT_SERVING, and
// will stay in NOT_SERVING.
shutdown bool
@@ -54,8 +54,8 @@
// Check implements `service Health`.
func (s *Server) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) {
- s.mu.Lock()
- defer s.mu.Unlock()
+ s.mu.RLock()
+ defer s.mu.RUnlock()
if servingStatus, ok := s.statusMap[in.Service]; ok {
return &healthpb.HealthCheckResponse{
Status: servingStatus,
@@ -139,7 +139,7 @@
// Shutdown sets all serving status to NOT_SERVING, and configures the server to
// ignore all future status changes.
//
-// This changes serving status for all services. To set status for a perticular
+// This changes serving status for all services. To set status for a particular
// services, call SetServingStatus().
func (s *Server) Shutdown() {
s.mu.Lock()
@@ -153,7 +153,7 @@
// Resume sets all serving status to SERVING, and configures the server to
// accept all future status changes.
//
-// This changes serving status for all services. To set status for a perticular
+// This changes serving status for all services. To set status for a particular
// services, call SetServingStatus().
func (s *Server) Resume() {
s.mu.Lock()