On Fri, Feb 15, 2013 at 11:10:24AM -0600, Jamie Strandboge wrote:
> +        for i in range(self.timeout): # Up to self.timeout seconds to start
>              rc, out = cmd(['xpra', 'list'])
> +
> +            if 'DEAD session at %s' % self.display in out:
> +                error("xpra session at '%s' died" % self.display, 
> do_exit=False)
> +                break
> +
> +            search = 'LIVE session at %s' % self.display
> +            if search in out:
>                  started = True
>                  break
>              time.sleep(1)
> +            debug("Could not find '%s' in:\n" % search)
> +            debug(out)

Could this sleep be changed to .5 seconds without too much overhead? Or,
how long does it usually take?

>          if not started:
>              sys.stdout.flush()
> @@ -638,6 +662,17 @@
>  
>          self.pids.append(listener_attach)
>  
> +        # Make sure that a client has attached
> +        for i in range(self.timeout): # up to self.timeout seconds to attach
> +            time.sleep(1)
> +            rc, out = cmd (['xpra', 'info', self.display])
> +            search = 'clients=1'
> +            if search in out:
> +                debug("Client successfully attached!")
> +                break
> +            debug("Could not find '%s' in:\n" % search)
> +            debug(out)
> +
>          msg("TODO: filter '~/.xpra/run-xpra'")

How about this sleep, too? Could the sleep be profitably moved after the
check, to optimistically assume that it might succeed immediately?

Thanks Jamie

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to