From: Sage Weil Date: Mon, 22 Oct 2012 21:14:09 +0000 (-0700) Subject: msg/Pipe: fix tight reconnect loop on connect failure X-Git-Tag: v0.55~218^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4d20b60970413ca1b55e73eaae087e686b72f6a5;p=ceph.git msg/Pipe: fix tight reconnect loop on connect failure The fault() call in connect should not set onread=true since connect is effectively a write path. This was forcing the writer() into a tight loop that repeatedly would call connect(); not very polite. Changing that, we want to avoid treating this as a normal fault (with the failure callback) and instead back off. Signed-off-by: Sage Weil Reviewed-by: Greg Farnum --- diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc index ec03244c938..a10392651df 100644 --- a/src/msg/Pipe.cc +++ b/src/msg/Pipe.cc @@ -882,7 +882,7 @@ int Pipe::connect() pipe_lock.Lock(); fail_locked: if (state == STATE_CONNECTING) - fault(true); + fault(); else ldout(msgr->cct,3) << "connect fault, but state = " << get_state_name() << " != connecting, stopping" << dendl; @@ -983,7 +983,7 @@ void Pipe::fault(bool onread) shutdown_socket(); // lossy channel? - if (policy.lossy) { + if (policy.lossy && state != STATE_CONNECTING) { ldout(msgr->cct,10) << "fault on lossy channel, failing" << dendl; stop();