From: xie xingguo Date: Sat, 17 Dec 2016 07:44:58 +0000 (+0800) Subject: common: make attempts of auth rotating configurable X-Git-Tag: v12.0.0~379^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f7bf80041ebcea08bb7d47f38a1d98c3b62c6248;p=ceph.git common: make attempts of auth rotating configurable Signed-off-by: xie xingguo --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index fb074b50f7def..929a76d3e17dd 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -381,6 +381,7 @@ OPTION(auth_cluster_required, OPT_STR, "cephx") // required of mon, mds, osd d OPTION(auth_service_required, OPT_STR, "cephx") // required by daemons of clients OPTION(auth_client_required, OPT_STR, "cephx, none") // what clients require of daemons OPTION(auth_supported, OPT_STR, "") // deprecated; default value for above if they are not defined. +OPTION(max_rotating_auth_attempts, OPT_INT, 10) OPTION(cephx_require_signatures, OPT_BOOL, false) // If true, don't talk to Cephx partners if they don't support message signing; off by default OPTION(cephx_cluster_require_signatures, OPT_BOOL, false) OPTION(cephx_service_require_signatures, OPT_BOOL, false) diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index d9c60fb986a01..7088c23ecdc6e 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -497,10 +497,8 @@ int MDSDaemon::init() } int rotating_auth_attempts = 0; - const int max_rotating_auth_attempts = 10; - while (monc->wait_auth_rotating(30.0) < 0) { - if (++rotating_auth_attempts <= max_rotating_auth_attempts) { + if (++rotating_auth_attempts <= g_conf->max_rotating_auth_attempts) { derr << "unable to obtain rotating service keys; retrying" << dendl; continue; } diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a5963412e0db9..2b39bfe50ca55 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2059,7 +2059,6 @@ int OSD::init() } int rotating_auth_attempts = 0; - const int max_rotating_auth_attempts = 10; // sanity check long object name handling { @@ -2273,7 +2272,7 @@ int OSD::init() while (monc->wait_auth_rotating(30.0) < 0) { derr << "unable to obtain rotating service keys; retrying" << dendl; ++rotating_auth_attempts; - if (rotating_auth_attempts > max_rotating_auth_attempts) { + if (rotating_auth_attempts > g_conf->max_rotating_auth_attempts) { osd_lock.Lock(); // make locker happy if (!is_stopping()) { r = - ETIMEDOUT;