[libvirt] [PATCH] rpc: wait longer for session daemon to start up

https://bugzilla.redhat.com/show_bug.cgi?id=1271183 We only wait .5 seconds for the session daemon to start up and present its socket, which isn't sufficient for many users. Bump up the sleep interval and retry amount so we wait for a total of 5 seconds. --- danpb suggests dropping the reverting this: commit be78814ae07f092d9c4e71fd82dd1947aba2f029 Author: Michal Privoznik <mprivozn@redhat.com> Date: Thu Apr 2 14:41:17 2015 +0200 virNetSocketNewConnectUNIX: Use flocks when spawning a daemon Prior to that we didn't need the retry logic at all... but that's a bit more involved and boxes users are suffering with this issue in the meantime src/rpc/virnetsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index b0d5b1c..d909b94 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -614,7 +614,7 @@ int virNetSocketNewConnectUNIX(const char *path, char *lockpath = NULL; int lockfd = -1; int fd = -1; - int retries = 100; + int retries = 500; virSocketAddr localAddr; virSocketAddr remoteAddr; char *rundir = NULL; @@ -707,7 +707,7 @@ int virNetSocketNewConnectUNIX(const char *path, daemonLaunched = true; } - usleep(5000); + usleep(10000); } localAddr.len = sizeof(localAddr.data); -- 2.5.0

On Tue, Mar 15, 2016 at 05:10:48PM -0400, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1271183
We only wait .5 seconds for the session daemon to start up and present its socket, which isn't sufficient for many users. Bump up the sleep interval and retry amount so we wait for a total of 5 seconds.
A longer delay is surely better, so ACK from me.
danpb suggests dropping the reverting this:
commit be78814ae07f092d9c4e71fd82dd1947aba2f029 Author: Michal Privoznik <mprivozn@redhat.com> Date: Thu Apr 2 14:41:17 2015 +0200
virNetSocketNewConnectUNIX: Use flocks when spawning a daemon
This commit references: https://bugzilla.redhat.com/show_bug.cgi?id=1200149 The test for that bug is very simple, just run the following command as *NON* root: killall libvirtd ; for i in `seq 1 5`; do virsh list >/tmp/log$i 2>&1 & done If some of the virsh instances fail, then you've hit the bug. Commit be78814a did appear to fix that. Whether that was coincidental or not, I don't know, but please don't reintroduce that bug, particularly as it is so simple to test for. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html

On Wed, Mar 16, 2016 at 09:52:31AM +0000, Richard W.M. Jones wrote:
On Tue, Mar 15, 2016 at 05:10:48PM -0400, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1271183
We only wait .5 seconds for the session daemon to start up and present its socket, which isn't sufficient for many users. Bump up the sleep interval and retry amount so we wait for a total of 5 seconds.
A longer delay is surely better, so ACK from me.
Unless it's half a minute or 20 seconds or whatever it was before as we were getting complaints for that. ACK from me too.
danpb suggests dropping the reverting this:
commit be78814ae07f092d9c4e71fd82dd1947aba2f029 Author: Michal Privoznik <mprivozn@redhat.com> Date: Thu Apr 2 14:41:17 2015 +0200
virNetSocketNewConnectUNIX: Use flocks when spawning a daemon
This commit references:
https://bugzilla.redhat.com/show_bug.cgi?id=1200149
The test for that bug is very simple, just run the following command as *NON* root:
killall libvirtd ; for i in `seq 1 5`; do virsh list >/tmp/log$i 2>&1 & done
If some of the virsh instances fail, then you've hit the bug.
Commit be78814a did appear to fix that. Whether that was coincidental or not, I don't know, but please don't reintroduce that bug, particularly as it is so simple to test for.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 03/16/2016 07:24 AM, Martin Kletzander wrote:
On Wed, Mar 16, 2016 at 09:52:31AM +0000, Richard W.M. Jones wrote:
On Tue, Mar 15, 2016 at 05:10:48PM -0400, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1271183
We only wait .5 seconds for the session daemon to start up and present its socket, which isn't sufficient for many users. Bump up the sleep interval and retry amount so we wait for a total of 5 seconds.
A longer delay is surely better, so ACK from me.
Unless it's half a minute or 20 seconds or whatever it was before as we were getting complaints for that. ACK from me too.
Thanks, pushed with Christophe's commit message tweak - Cole

On Tue, Mar 15, 2016 at 05:10:48PM -0400, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1271183
We only wait .5 seconds for the session daemon to start up and present
If this is not pushed already, I think 0.5 seconds would be easier to read and not confuse with the "5 seconds" below (at first I thought there was a typo in the commit log and you typed '5' twice). Christophe
its socket, which isn't sufficient for many users. Bump up the sleep interval and retry amount so we wait for a total of 5 seconds. --- danpb suggests dropping the reverting this:
commit be78814ae07f092d9c4e71fd82dd1947aba2f029 Author: Michal Privoznik <mprivozn@redhat.com> Date: Thu Apr 2 14:41:17 2015 +0200
virNetSocketNewConnectUNIX: Use flocks when spawning a daemon
Prior to that we didn't need the retry logic at all... but that's a bit more involved and boxes users are suffering with this issue in the meantime
src/rpc/virnetsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index b0d5b1c..d909b94 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -614,7 +614,7 @@ int virNetSocketNewConnectUNIX(const char *path, char *lockpath = NULL; int lockfd = -1; int fd = -1; - int retries = 100; + int retries = 500; virSocketAddr localAddr; virSocketAddr remoteAddr; char *rundir = NULL; @@ -707,7 +707,7 @@ int virNetSocketNewConnectUNIX(const char *path, daemonLaunched = true; }
- usleep(5000); + usleep(10000); }
localAddr.len = sizeof(localAddr.data); -- 2.5.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (4)
-
Christophe Fergeau
-
Cole Robinson
-
Martin Kletzander
-
Richard W.M. Jones