Skip to content

Commit

Permalink
etcdserver: fix "lease_expired_total" metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Apr 10, 2018
1 parent e095ee4 commit 744c73e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,13 @@ func (s *EtcdServer) run() {
lid := lease.ID
s.goAttach(func() {
ctx := s.authStore.WithRoot(s.ctx)
if _, lerr := s.LeaseRevoke(ctx, &pb.LeaseRevokeRequest{ID: int64(lid)}); lerr != nil {
_, lerr := s.LeaseRevoke(ctx, &pb.LeaseRevokeRequest{ID: int64(lid)})
if lerr == nil {
leaseExpired.Inc()
} else {
plog.Warningf("failed to revoke %016x (%q)", lid, lerr.Error())
}
leaseExpired.Inc()

<-c
})
}
Expand Down

0 comments on commit 744c73e

Please sign in to comment.