until += ceph::make_timespan(timeout);
if (timeout > 0.0)
ldout(cct, 10) << "authenticate will time out at " << until << dendl;
- authenticate_err = 1; // == in progress
while (!active_con && authenticate_err >= 0) {
if (timeout > 0.0) {
auto r = auth_cond.wait_until(lock, until);
_check_auth_tickets();
}
auth_cond.notify_all();
-
- if (!auth_err) {
- Context *cb = nullptr;
- if (session_established_context) {
- cb = session_established_context.release();
- }
- if (cb) {
- monc_lock.unlock();
- cb->complete(0);
- monc_lock.lock();
- }
- }
}
// ---------
active_con.reset();
pending_cons.clear();
+ authenticate_err = 1; // == in progress
+
_start_hunting();
if (rank >= 0) {
return 0;
ldout(cct, 10) << __func__ << " waiting for " << timeout << dendl;
- utime_t now = ceph_clock_now();
- if (auth_cond.wait_for(l, ceph::make_timespan(timeout), [now, this] {
+ utime_t cutoff = ceph_clock_now();
+ cutoff -= std::min(30.0, cct->_conf->auth_service_ticket_ttl / 4.0);
+ if (auth_cond.wait_for(l, ceph::make_timespan(timeout), [this, cutoff] {
return (!auth_principal_needs_rotating_keys(entity_name) ||
- !rotating_secrets->need_new_secrets(now));
+ !rotating_secrets->need_new_secrets(cutoff));
})) {
ldout(cct, 10) << __func__ << " done" << dendl;
return 0;