Re: Bug#385976: strange (and annoying) delay on startup
On Mon, Sep 11, 2006 at 04:19:57PM +0200, Loïc Minier wrote:
> reassign 385976 libice6
> retitle 385976 SocketUNIXConnect shouldn't return TRANS_TRY_CONNECT_AGAIN when the socket file doesn't exist
> severity 385976 minor
> stop
>
> Hi,
>
> On Sun, Sep 10, 2006, Robert Millan wrote:
> > Interesting... it turns out my shell's $SESSION_MANAGER is pointing to
> > a socket that belonged to an older X session. As to why this happens,
> > my shell was spawned by a screen session that's much older than my X
> > server (when I have to restart X I just detach from screen, and later
> > reattach).
> >
> > However, that doesn't explain the delay. You can tell the socket is
> > not there inmediately.
>
> This is presumably a bug in libICE (Inter-Client Exchange library), or
> even in xtrans.
> When libICE fails connecting (in ConnectToPeer), and gets
> TRANS_TRY_CONNECT_AGAIN, it will retry the connection 5 times with a 1
> second sleep() between retries.
>
> The "local" Xtrans transport can either be implemented in Xtranslcl
> which never returns TRANS_TRY_CONNECT_AGAIN, but returns
> TRANS_CONNECT_FAILED, or in Xtranssock. Hence, here it's obviously in
> Xtranssock that the code is.
>
> Looking at the code, when connect() fails with ENOENT ("No such file or
> directory"), SocketUNIXConnect returns TRANS_TRY_CONNECT_AGAIN, and a
> comment says (Xtranssock.c:2048):
> * If the error was ENOENT, the server may be starting up
> * and we should try again.
Thanks for the ellaboration. This sounds like a strange race, though. It
would require the user to launch the client before the server has finished its
startup, which AFAICT can only be done from a shell that doesn't belong to
this server session.
Is this hack required for the initial X client? If this is so, waiting 5s is
not a good solution to workaround lack of syncronisation anyway.
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended for
spam harvesters. Writing to it will get you added to my black list.
Reply to: