mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 22:17:17 +00:00
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
This commit is contained in:
parent
8da02d5280
commit
2eb7a97575
@ -619,6 +619,7 @@ int virNetSocketNewConnectUNIX(const char *path,
|
|||||||
virSocketAddr remoteAddr;
|
virSocketAddr remoteAddr;
|
||||||
char *rundir = NULL;
|
char *rundir = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
bool daemonLaunched = false;
|
||||||
|
|
||||||
VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon,
|
VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon,
|
||||||
NULLSTR(binary));
|
NULLSTR(binary));
|
||||||
@ -699,8 +700,12 @@ int virNetSocketNewConnectUNIX(const char *path,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virNetSocketForkDaemon(binary) < 0)
|
if (!daemonLaunched) {
|
||||||
goto cleanup;
|
if (virNetSocketForkDaemon(binary) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
daemonLaunched = true;
|
||||||
|
}
|
||||||
|
|
||||||
usleep(5000);
|
usleep(5000);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user