Merge pull request #14166 from chavacava/fix-14162

fix #14162
This commit is contained in:
Benjamin Wang 2022-06-27 09:38:33 +08:00 committed by GitHub
commit 19f5ff664a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,11 +17,10 @@ package runner
import (
"context"
"errors"
"fmt"
"log"
"time"
"go.etcd.io/etcd/client/v3"
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/spf13/cobra"
"google.golang.org/grpc/codes"
@ -71,15 +70,10 @@ func runLeaseRenewerFunc(cmd *cobra.Command, args []string) {
if ev, ok := status.FromError(err); ok && ev.Code() == codes.NotFound {
if time.Since(expire) < 0 {
log.Fatalf("bad renew! exceeded: %v", time.Since(expire))
for {
lk, err = c.Lease.KeepAliveOnce(ctx, l.ID)
fmt.Println(lk, err)
time.Sleep(time.Second)
}
}
log.Fatalf("lost lease %d, expire: %v\n", l.ID, expire)
break
}
if err != nil {
continue
}