[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#519009: Xtrans should not return TRANS_TRY_CONNECT_AGAIN when it cannot connect to abstract socket



On Mon, Mar  9, 2009 at 21:57:43 +0100, David Madore wrote:

> The following code (lines 2058-2066 of Xtranssock.c) is wrong:
> 
> 	    else if (olderrno == ENOENT || olderrno == ECONNREFUSED) {
> 		/* If opening as abstract socket failed, try again normally */
> 		if (abstract) {
> 		    ciptr->transptr->flags &= ~(TRANS_ABSTRACT);
> 		    return TRANS_TRY_CONNECT_AGAIN;
> 		} else {
> 		    return TRANS_CONNECT_FAILED;
> 		}
> 	    } else {
> 
> What this intends to do is that if Xtrans can't connect on an abstract
> domain socket, it will retry on the concrete Unix socket of the same
> name: to do this, whoever wrote this code thought that returning
> TRANS_TRY_CONNECT_AGAIN would do the trick, as the caller would then
> retry.
> 
> Unfortunatly, TRANS_TRY_CONNECT_AGAIN actually means "try again after
> a delay" and not "try again immediately".  So this code means that,
> since I use a session manager that does not create an abstract domain
> socket, every client trying to contact it (with the new Xtrans,
> through libSM and libICE) sleeps for one second before starting,
> because it first attempts to contact the abstract socket, then sleeps
> for one second before trying the concrete Unix socket.
> 
Hi David,

Sorry for the delay in replying to this.
Is there any chance you could propose a patch implementing your
suggestion?

Thanks,
Julien



Reply to: