mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: deprecate grpc.Code, grpc.ErrorDesc
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
@@ -24,8 +24,8 @@ import (
|
||||
"github.com/coreos/etcd/clientv3"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -68,7 +68,8 @@ func runLeaseRenewerFunc(cmd *cobra.Command, args []string) {
|
||||
|
||||
for {
|
||||
lk, err = c.Lease.KeepAliveOnce(ctx, l.ID)
|
||||
if grpc.Code(err) == codes.NotFound {
|
||||
ev, _ := status.FromError(err)
|
||||
if ev.Code() == codes.NotFound {
|
||||
if time.Since(expire) < 0 {
|
||||
log.Fatalf("bad renew! exceeded: %v", time.Since(expire))
|
||||
for {
|
||||
|
||||
@@ -106,7 +106,7 @@ func (s *keyStresser) run(ctx context.Context) {
|
||||
continue
|
||||
}
|
||||
|
||||
switch grpc.ErrorDesc(err) {
|
||||
switch rpctypes.ErrorDesc(err) {
|
||||
case context.DeadlineExceeded.Error():
|
||||
// This retries when request is triggered at the same time as
|
||||
// leader failure. When we terminate the leader, the request to
|
||||
|
||||
Reference in New Issue
Block a user