It's possible that we successfully set active_con *and* time out the
cond WaitUntil. Only set the error if we don't have a connection; if we
set it *and* time out then let's call it success.
Signed-off-by: Sage Weil <sage@redhat.com>
until += timeout;
if (timeout > 0.0)
ldout(cct, 10) << "authenticate will time out at " << until << dendl;
+ authenticate_err = 0;
while (!active_con && !authenticate_err) {
if (timeout > 0.0) {
int r = auth_cond.WaitUntil(monc_lock, until);
- if (r == ETIMEDOUT) {
+ if (r == ETIMEDOUT && !active_con) {
ldout(cct, 0) << "authenticate timed out after " << timeout << dendl;
authenticate_err = -r;
}