Skip to content

Commit

Permalink
Merge pull request #9557 from gyuho/lease-metrics
Browse files Browse the repository at this point in the history
etcdserver: fix "lease_expired_total" metrics
  • Loading branch information
gyuho committed Apr 10, 2018
2 parents cf0a138 + 744c73e commit 943962d
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 943962d

Please sign in to comment.