Skip to contentSkip to conversation

vnc: fix update stalls

PATCH In review Gerd Hoffmann 2 participants 2 messages Mar 5, 2019 – Mar 6, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vnc: fix update stalls

vnc aborts display update jobs on video mode switches and page flips. That can cause vnc update stalls in case an unfinished vnc job gets aborted. The vnc client will never receive the requested update then. Fix that by copying the state from job_update back to update in that case.

Reports complain about stalls with two or more clients being connected at the same time, on some but not all connections. I suspect it can also happen with a single connection, multiple connections only make this more much likely to happen.

---
 ui/vnc.c | 6 ++++++
 1 file changed, 6 insertions(+)
ui/vnc.c +6 -0
index da4a21d4ce94..2f2ab62fcf71 100644
@@ -700,6 +700,12 @@ static void vnc_abort_display_jobs(VncDisplay *vd)
     }
     QTAILQ_FOREACH(vs, &vd->clients, next) {
         vnc_lock_output(vs);
+        if (vs->update == VNC_STATE_UPDATE_NONE &&
+            vs->job_update != VNC_STATE_UPDATE_NONE) {
+            /* job aborted before completion */
+            vs->update = vs->job_update;
+            vs->job_update = VNC_STATE_UPDATE_NONE;
+        }
         vs->abort = false;
         vnc_unlock_output(vs);
     }
Signature · 1 line
2.18.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gerd Hoffmann

vnc aborts display update jobs on video mode switches and page flips. That can cause vnc update stalls in case an unfinished vnc job gets aborted. The vnc client will never receive the requested update then. Fix that by copying the state from job_update back to update in that case.

Quoted 8 lines

Reports complain about stalls with two or more clients being connected at the same time, on some but not all connections. I suspect it can also happen with a single connection, multiple connections only make this more much likely to happen.

Quoted 22 lines
---
 ui/vnc.c | 6 ++++++
 1 file changed, 6 insertions(+)
ui/vnc.c +6 -0
index da4a21d4ce94..2f2ab62fcf71 100644
@@ -700,6 +700,12 @@ static void vnc_abort_display_jobs(VncDisplay *vd)
     }
     QTAILQ_FOREACH(vs, &vd->clients, next) {
         vnc_lock_output(vs);
+        if (vs->update == VNC_STATE_UPDATE_NONE &&
+            vs->job_update != VNC_STATE_UPDATE_NONE) {
+            /* job aborted before completion */
+            vs->update = vs->job_update;
+            vs->job_update = VNC_STATE_UPDATE_NONE;
+        }
         vs->abort = false;
         vnc_unlock_output(vs);
     }