From aa41742c83f2c745792d720a1b45524f8b6cda96 Mon Sep 17 00:00:00 2001 From: zhucan Date: Fri, 16 Sep 2022 10:26:20 +0800 Subject: [PATCH] pool: add timeout to rbd cmd Signed-off-by: zhucan --- pkg/operator/ceph/pool/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/pool/controller.go b/pkg/operator/ceph/pool/controller.go index 2e17b8568..a77180aa2 100644 --- a/pkg/operator/ceph/pool/controller.go +++ b/pkg/operator/ceph/pool/controller.go @@ -25,6 +25,7 @@ import ( "github.com/coreos/pkg/capnslog" cephclient "github.com/rook/rook/pkg/daemon/ceph/client" + "github.com/rook/rook/pkg/util/exec" "github.com/pkg/errors" cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" @@ -390,7 +391,7 @@ func createPool(context *clusterd.Context, clusterInfo *cephclient.ClusterInfo, } logger.Infof("initializing pool %q for RBD use", p.Name) args := []string{"pool", "init", p.Name} - output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run() + output, err := cephclient.NewRBDCommand(context, clusterInfo, args).RunWithTimeout(exec.CephCommandsTimeout) if err != nil { return errors.Wrapf(err, "failed to initialize pool %q for RBD use. %s", p.Name, string(output)) }