From patchwork Sat Jul 21 00:41:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 1222851 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B1EC9E0038 for ; Sat, 21 Jul 2012 00:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753103Ab2GUAdP (ORCPT ); Fri, 20 Jul 2012 20:33:15 -0400 Received: from cobra.newdream.net ([66.33.216.30]:46574 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753045Ab2GUAdL (ORCPT ); Fri, 20 Jul 2012 20:33:11 -0400 Received: from fatty.ops.newdream.net (unknown [38.122.20.226]) by cobra.newdream.net (Postfix) with ESMTPA id 4C4D08135C; Fri, 20 Jul 2012 17:33:10 -0700 (PDT) From: Sage Weil To: ceph-devel@vger.kernel.org Cc: Sage Weil Subject: [PATCH 9/9] libceph: reset connection retry on successfully negotiation Date: Fri, 20 Jul 2012 17:41:48 -0700 Message-Id: <1342831308-18815-10-git-send-email-sage@inktank.com> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1342831308-18815-1-git-send-email-sage@inktank.com> References: <1342831308-18815-1-git-send-email-sage@inktank.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org We exponentially back off when we encounter connection errors. If several errors accumulate, we will eventually wait ages before even trying to reconnect. Fix this by resetting the backoff counter after a successful negotiation/ connection with the remote node. Fixes ceph issue #2802. Signed-off-by: Sage Weil Reviewed-by: Yehuda Sadeh --- net/ceph/messenger.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 65964c2..28896eb 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1633,6 +1633,8 @@ static int process_connect(struct ceph_connection *con) if (con->in_reply.flags & CEPH_MSG_CONNECT_LOSSY) set_bit(LOSSYTX, &con->flags); + con->delay = 0; /* reset backoff memory */ + prepare_read_tag(con); break;