Blame SOURCES/0009-red_worker-decrease-the-timeout-when-flushing-comman.patch

e2c81d
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4c08dd
From: Yonit Halperin <yhalperi@redhat.com>
4c08dd
Date: Mon, 5 Aug 2013 12:10:15 -0400
20333d
Subject: [PATCH] red_worker: decrease the timeout when flushing commands and
20333d
 waiting for the client.
4c08dd
4c08dd
150 seconds is way too long period for holding the guest driver and
4c08dd
waiting for a response for the client. This timeout was 15 seconds, but
4c08dd
when off-screen surfaces ware introduced it was arbitrarily multiplied by
4c08dd
10.
4c08dd
Other existing related bugs emphasize why it is important to decrease
4c08dd
the timeout:
4c08dd
(1) 994211 - the qxl driver waits for an async-io reponse for 60 seconds
4c08dd
    and after that, it switches to sync-io mode. Not only that the
4c08dd
    driver might use invalid data (since it didn't wait for the query to
4c08dd
    complete), falling back to sync-io mode introduces other errors.
4c08dd
(2) 994175 - spice server sometimes doesn't recognize that the client
4c08dd
             has disconnected.
4c08dd
(3) There might be cache inconsistency between the client and the server,
4c08dd
and then the display channel waits indefinitely for a cache item (e.g., bug
4c08dd
977998)
4c08dd
4c08dd
This patch changes the timeout to 30 seconds. I tested it under wifi +emulating 2.5Mbps network,
4c08dd
together with playing video on the guest and changing resolutions in a loop. The timeout didn't expired
4c08dd
during my tests.
4c08dd
4c08dd
This bug is related to rhbz#964136 (but from rhbz#964136 info it is still not
4c08dd
clear why the client wasn't responsive).
4c08dd
---
20333d
 server/red_worker.c | 6 +++---
20333d
 1 file changed, 3 insertions(+), 3 deletions(-)
4c08dd
4c08dd
diff --git a/server/red_worker.c b/server/red_worker.c
20333d
index 73fe866..a4f0663 100644
4c08dd
--- a/server/red_worker.c
4c08dd
+++ b/server/red_worker.c
4c08dd
@@ -103,7 +103,7 @@
4c08dd
 #define CHANNEL_PUSH_TIMEOUT 30000000000ULL //nano
4c08dd
 #define CHANNEL_PUSH_SLEEP_DURATION 10000 //micro
4c08dd
 
4c08dd
-#define DISPLAY_CLIENT_TIMEOUT 15000000000ULL //nano
4c08dd
+#define DISPLAY_CLIENT_TIMEOUT 30000000000ULL //nano
4c08dd
 #define DISPLAY_CLIENT_MIGRATE_DATA_TIMEOUT 10000000000ULL //nano, 10 sec
4c08dd
 #define DISPLAY_CLIENT_RETRY_INTERVAL 10000 //micro
4c08dd
 
20333d
@@ -9721,7 +9721,7 @@ static inline void flush_display_commands(RedWorker *worker)
4c08dd
         if (ring_is_empty) {
4c08dd
             break;
4c08dd
         }
4c08dd
-        end_time = red_now() + DISPLAY_CLIENT_TIMEOUT * 10;
4c08dd
+        end_time = red_now() + DISPLAY_CLIENT_TIMEOUT;
4c08dd
         int sleep_count = 0;
4c08dd
         for (;;) {
4c08dd
             red_channel_push(&worker->display_channel->common.base);
20333d
@@ -9765,7 +9765,7 @@ static inline void flush_cursor_commands(RedWorker *worker)
4c08dd
         if (ring_is_empty) {
4c08dd
             break;
4c08dd
         }
4c08dd
-        end_time = red_now() + DISPLAY_CLIENT_TIMEOUT * 10;
4c08dd
+        end_time = red_now() + DISPLAY_CLIENT_TIMEOUT;
4c08dd
         int sleep_count = 0;
4c08dd
         for (;;) {
4c08dd
             red_channel_push(&worker->cursor_channel->common.base);