Browse Source

v3rpc: only fill lease grant header if no error

Was panicking under cluster fault injection.
Anthony Romano 9 years ago
parent
commit
06ea8aee11
1 changed files with 3 additions and 0 deletions
  1. 3 0
      etcdserver/api/v3rpc/lease.go

+ 3 - 0
etcdserver/api/v3rpc/lease.go

@@ -38,6 +38,9 @@ func (ls *LeaseServer) LeaseGrant(ctx context.Context, cr *pb.LeaseGrantRequest)
 	if err == lease.ErrLeaseExists {
 		return nil, rpctypes.ErrLeaseExist
 	}
+	if err != nil {
+		return nil, err
+	}
 	ls.hdr.fill(resp.Header)
 	return resp, err
 }