]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Pipe: fix tight reconnect loop on connect failure
authorSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 21:14:09 +0000 (14:14 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 21:47:01 +0000 (14:47 -0700)
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 <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/msg/Pipe.cc

index ec03244c938e97fcfbaf23d3ca326f9511a0117e..a10392651df31c9c2b4c1ddc8c6fd26a56734252 100644 (file)
@@ -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();