Skip to content

Commit 574fd86

Browse files
author
Deepika
committed
src/mon: fix hang on wait_until during mon authentication
fixes: https://tracker.ceph.com/issues/50761 Signed-off-by: Deepika Upadhyay <[email protected]>
1 parent 1f83b29 commit 574fd86

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/mon/MonClient.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,11 @@ int MonClient::authenticate(double timeout)
572572
if (!_opened())
573573
_reopen_session();
574574

575-
auto until = ceph::mono_clock::now();
576-
until += ceph::make_timespan(timeout);
577-
if (timeout > 0.0)
578-
ldout(cct, 10) << "authenticate will time out at " << until << dendl;
579575
while (!active_con && authenticate_err >= 0) {
580576
if (timeout > 0.0) {
577+
auto until = ceph::mono_clock::now();
578+
until += ceph::make_timespan(timeout);
579+
ldout(cct, 10) << "authenticate will time out at " << until << dendl;
581580
auto r = auth_cond.wait_until(lock, until);
582581
if (r == std::cv_status::timeout && !active_con) {
583582
ldout(cct, 0) << "authenticate timed out after " << timeout << dendl;

0 commit comments

Comments
 (0)