gtk client side timeouts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey all,

We've got an issue with a remote viewer kiosk.  That is, in our normal
mode of operation, if something goes wrong with a client connection
(e.g. the sessions is killed, server restarted normally), the kiosk will
exit on disconnect, and we get a chance to retry the connection, or
present the user with a 'server down' style message.

But in the case of a serious network problem or a server hard power
cycle (i.e. no TCP FIN packets can flow), our end user behavior is not
ideal - the kiosk appears to hang solid, requiring a power cycle.

That's because we've got the stock keepalive timeouts, or about 2 hours
and 11 minutes, before the client sees the disconnect.

Now this is a relatively rare occurrence, and arguably a minor nuisance,
but I've been asked to see what it would take to improve the situation.

I looked for past discussions on spice-devel; I only readily found
discussion of the keepalive parameters on the server side, and it looks
like we take the idle timer down to 10 minutes now, from 2 hours.  I
didn't find discussion of something similar client side.

Have we considered tuning them on the spice-gtk client side?

The attached patch applies a roughly 75 second timeout for me; is this
something that would be viable to add to the gtk client, even if only as
an option?

Cheers,

Jeremy
diff --git a/src/spice-session.c b/src/spice-session.c
index 66376ff..2790d89 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -18,6 +18,7 @@
 #include "config.h"
 
 #include <gio/gio.h>
+#include <gio/gnetworking.h>
 #include <glib.h>
 #ifdef G_OS_UNIX
 #include <gio/gunixsocketaddress.h>
@@ -2211,6 +2212,11 @@ GSocketConnection* spice_session_channel_open_host(SpiceSession *session, SpiceC
         g_socket_set_timeout(socket, 0);
         g_socket_set_blocking(socket, FALSE);
         g_socket_set_keepalive(socket, TRUE);
+
+        /* Experiment with making the client timeout a bit more responsive */
+        g_socket_set_option(socket, IPPROTO_TCP, TCP_KEEPIDLE, 30, NULL);
+        g_socket_set_option(socket, IPPROTO_TCP, TCP_KEEPINTVL, 15, NULL);
+        g_socket_set_option(socket, IPPROTO_TCP, TCP_KEEPCNT, 3, NULL);
     }
 
     g_clear_object(&open_host.client);
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]