[Spice-devel] [PATCH] Wait to send monitor config until agent caps are received

Jonathon Jongsma jjongsma at redhat.com
Thu Aug 28 11:29:55 PDT 2014


On Thu, 2014-08-28 at 12:57 -0400, Marc-André Lureau wrote:
> 
> ----- Original Message -----
> > > > To solve the issue, we trigger a display update when the agent becomes
> > > > connected, but give it a long timeout (e.g. 5 seconds). This gives some
> > > > time
> > > 
> > > To avoid the timeout, we could rely on the agent caps reply to happen
> > > right after sending the client caps->request, no?
> > 
> > Perhaps I don't understand your suggestion, but this 5-second timeout is
> > only to handle the case where the server doesn't actually send an agent
> > caps message. In the normal case (where the server sends its
> > capabilities), there will be no timeout because we'll trigger a display
> > update immediately after receiving the agent caps reply...
> 
> 
> Yes, but what if the reply doesn't come after 5s, we will still get the
> same bugs I suppose.

If the reply doesn't come after 5s, then we assume that the server is
old and doesn't support sparse monitor configurations. In this case,
sending down a non-sparse configuration would be the correct approach,
and not a bug. If it was simply a matter of a (very) bad network
connection and it took longer than 5s for the server to negotiate the
agent capabilities, then this behavior could be considered a bug.  But I
chose a large value (5s) since I thought it would be reasonable to
assume that any server that didn't respond within this time was likely
not to respond.

> 
> As you may agree, it's best to avoid timers (some exceptions are those
> that are user or HI related timers, such as the delay timer for monitor
> resize)

But I already explained that in the *normal* case, this timer will never
be triggered. Once we receive the agent capabilities message (which
should be very soon after the agent becomes connected), we will trigger
an immediate display configuration (canceling the timer). The timer is
only intended to be a fallback to catch the case where the capabilities
message never arrives. If there was no fallback timer and no
capabilities message ever arrived, we would never send a display
configuration. 

Are you saying that you think that it's OK for us not to send down a
display configuration in this situation? Maybe 5s is so long that it's
not worth sending a configuration message anymore?

Jonathon



More information about the Spice-devel mailing list