From 4d20b60970413ca1b55e73eaae087e686b72f6a5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Oct 2012 14:14:09 -0700 Subject: [PATCH] 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 --- src/msg/Pipe.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc index ec03244c938e9..a10392651df31 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(); -- 2.39.5