@@ -16,7 +16,6 @@ package etcd
1616import (
1717 "context"
1818 "crypto/tls"
19- stderrors "errors"
2019 "fmt"
2120 "sync"
2221 "time"
@@ -141,7 +140,7 @@ func retryRPC(rpcName string, metric prometheus.Counter, etcdRPC func() error) e
141140 // 16s = \sum_{n=0}^{6} 0.5*1.5^n
142141 return retry .Do (context .Background (), func () error {
143142 err := etcdRPC ()
144- if err != nil && ! stderrors .Is (errors .Cause (err ), context .Canceled ) {
143+ if err != nil && ! cerror .Is (errors .Cause (err ), context .Canceled ) {
145144 log .Warn ("etcd RPC failed" , zap .String ("RPC" , rpcName ), zap .Error (err ))
146145 }
147146 if metric != nil {
@@ -353,7 +352,7 @@ func isRetryableError(rpcName string) retry.IsRetryable {
353352 switch rpcName {
354353 case EtcdRevoke :
355354 var etcdErr v3rpc.EtcdError
356- if stderrors .As (err , & etcdErr ) && etcdErr .Code () == codes .NotFound {
355+ if cerror .As (err , & etcdErr ) && etcdErr .Code () == codes .NotFound {
357356 // It means the etcd lease is already expired or revoked
358357 return false
359358 }
@@ -616,5 +615,5 @@ func IsHealthy(ctx context.Context, client *clientv3.Client) bool {
616615 _ , err := client .Get (ctx , healthyPath )
617616 // permission denied is OK since proposal goes through consensus to get it
618617 // See: https://github.com/etcd-io/etcd/blob/85b640cee793e25f3837c47200089d14a8392dc7/etcdctl/ctlv3/command/ep_command.go#L124
619- return err == nil || stderrors .Is (err , rpctypes .ErrPermissionDenied )
618+ return err == nil || cerror .Is (err , rpctypes .ErrPermissionDenied )
620619}
0 commit comments