浏览代码

v3rpc: only fill lease grant header if no error

Was panicking under cluster fault injection.
Anthony Romano 9 年之前
父节点
当前提交
06ea8aee11
共有 1 个文件被更改,包括 3 次插入0 次删除
  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
 }