Explorar o código

v3rpc: only fill lease grant header if no error

Was panicking under cluster fault injection.
Anthony Romano %!s(int64=9) %!d(string=hai) anos
pai
achega
06ea8aee11
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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
 }