Commit bee3a37c authored by Ilya Dryomov's avatar Ilya Dryomov
Browse files

libceph: reschedule tick in mon_fault()

Doing __schedule_delayed() in the hunting branch is pointless, as the
tick will have already been scheduled by then.

What we need to do instead is *reschedule* it in the !hunting branch,
after reopen_session() changes hunt_mult, which affects the delay.
This helps with spacing out connection attempts and avoiding things
like two back-to-back attempts followed by a longer period of waiting
Signed-off-by: default avatarIlya Dryomov <>
parent 1752b50c
...@@ -222,8 +222,8 @@ static void __schedule_delayed(struct ceph_mon_client *monc) ...@@ -222,8 +222,8 @@ static void __schedule_delayed(struct ceph_mon_client *monc)
dout("__schedule_delayed after %lu\n", delay); dout("__schedule_delayed after %lu\n", delay);
schedule_delayed_work(&monc->delayed_work, mod_delayed_work(system_wq, &monc->delayed_work,
round_jiffies_relative(delay)); round_jiffies_relative(delay));
} }
const char *ceph_sub_str[] = { const char *ceph_sub_str[] = {
...@@ -1166,9 +1166,9 @@ static void mon_fault(struct ceph_connection *con) ...@@ -1166,9 +1166,9 @@ static void mon_fault(struct ceph_connection *con)
if (!monc->hunting) { if (!monc->hunting) {
dout("%s hunting for new mon\n", __func__); dout("%s hunting for new mon\n", __func__);
reopen_session(monc); reopen_session(monc);
} else {
/* already hunting, let's wait a bit */
__schedule_delayed(monc); __schedule_delayed(monc);
} else {
dout("%s already hunting\n", __func__);
} }
out: out:
mutex_unlock(&monc->mutex); mutex_unlock(&monc->mutex);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment