From patchwork Tue Jan 12 01:22:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 59591 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2451589lbb; Mon, 11 Jan 2016 17:25:54 -0800 (PST) X-Received: by 10.55.77.206 with SMTP id a197mr164786859qkb.43.1452561954685; Mon, 11 Jan 2016 17:25:54 -0800 (PST) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id u4si49999437qka.50.2016.01.11.17.25.53 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jan 2016 17:25:54 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0C1NPcs026706; Mon, 11 Jan 2016 20:23:26 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0C1Mg11022166 for ; Mon, 11 Jan 2016 20:22:42 -0500 Received: from colepc.redhat.com (ovpn-113-33.phx2.redhat.com [10.3.113.33]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0C1McU4016771; Mon, 11 Jan 2016 20:22:42 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 11 Jan 2016 20:22:34 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] rpc: socket: Don't repeatedly attempt to launch daemon X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com On every socket connect(2) attempt we were re-launching session libvirtd, up to 100 times in 5 seconds. This understandably caused some weird load races and intermittent qemu:///session startup failures https://bugzilla.redhat.com/show_bug.cgi?id=1271183 --- src/rpc/virnetsocket.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 2d6d44f..368774a 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -619,6 +619,7 @@ int virNetSocketNewConnectUNIX(const char *path, virSocketAddr remoteAddr; char *rundir = NULL; int ret = -1; + bool daemonLaunched = false; VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon, NULLSTR(binary)); @@ -699,8 +700,12 @@ int virNetSocketNewConnectUNIX(const char *path, goto cleanup; } - if (virNetSocketForkDaemon(binary) < 0) - goto cleanup; + if (!daemonLaunched) { + if (virNetSocketForkDaemon(binary) < 0) + goto cleanup; + + daemonLaunched = true; + } usleep(5000); }