diff options
author | Cole Robinson <crobinso@redhat.com> | 2016-01-11 20:13:38 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2016-01-20 19:13:32 -0500 |
commit | 40df40f35a2c9a63cb42353824691f11eed41254 (patch) | |
tree | 7321b261709ad9a49a8bcf61baad6726e497356e /src | |
parent | 2e4d173b49949615c9820e495ae16352ac55c585 (diff) | |
download | libvirt-40df40f35a2c9a63cb42353824691f11eed41254.tar.gz |
rpc: socket: Don't repeatedly attempt to launch daemon
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
(cherry picked from commit 2eb7a975756d05a5b54ab4acf60083beb6161ac6)
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/virnetsocket.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 6a51dc840b..b132532be6 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); } |