[libvirt] [PATCH] remote: increase daemon shutdown timer to 2 minutes

Daniel P. Berrangé posted 1 patch 4 years, 9 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190718145301.6947-1-berrange@redhat.com
src/remote/libvirtd.service.in | 2 +-
src/rpc/virnetsocket.c         | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH] remote: increase daemon shutdown timer to 2 minutes
Posted by Daniel P. Berrangé 4 years, 9 months ago
Shutting down the daemon after 30 seconds of being idle is a little bit
too aggressive. Especially when using 'virsh' in single-shot mode, as
opposed to interactive shell mode, it would not be unusual to have
more than 30 seconds between commands. This will lead to the daemon
shutting down and starting up between a series of commands.

Increasing the shutdown timer to 2 minutes will make it less likely that
the daemon will shutdown while the user is in the middle of a series of
commands.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/remote/libvirtd.service.in | 2 +-
 src/rpc/virnetsocket.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
index 2e51429e7a..3ddf0e229b 100644
--- a/src/remote/libvirtd.service.in
+++ b/src/remote/libvirtd.service.in
@@ -25,7 +25,7 @@ EnvironmentFile=-/etc/sysconfig/libvirtd
 # VMs can be performed. We don't want it to stick around if
 # unused though, so we set a timeout. The socket activation
 # then ensures it gets started again if anything needs it
-ExecStart=@sbindir@/libvirtd --timeout 30 $LIBVIRTD_ARGS
+ExecStart=@sbindir@/libvirtd --timeout 120 $LIBVIRTD_ARGS
 ExecReload=/bin/kill -HUP $MAINPID
 KillMode=process
 Restart=on-failure
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 34a9947eb3..3282bc0817 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -137,7 +137,7 @@ static int virNetSocketForkDaemon(const char *binary)
 {
     int ret;
     virCommandPtr cmd = virCommandNewArgList(binary,
-                                             "--timeout=30",
+                                             "--timeout=120",
                                              NULL);
 
     virCommandAddEnvPassCommon(cmd);
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] remote: increase daemon shutdown timer to 2 minutes
Posted by Jim Fehlig 4 years, 9 months ago
On 7/18/19 8:53 AM, Daniel P. Berrangé  wrote:
> Shutting down the daemon after 30 seconds of being idle is a little bit
> too aggressive. Especially when using 'virsh' in single-shot mode, as
> opposed to interactive shell mode, it would not be unusual to have
> more than 30 seconds between commands. This will lead to the daemon
> shutting down and starting up between a series of commands.
> 
> Increasing the shutdown timer to 2 minutes will make it less likely that
> the daemon will shutdown while the user is in the middle of a series of
> commands.

I often use virsh in single-shot mode, and often get distracted, so 5 minutes is 
more to my taste :-).

> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   src/remote/libvirtd.service.in | 2 +-
>   src/rpc/virnetsocket.c         | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Jim Fehlig <jfehlig@suse.com>

Regards,
Jim

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list