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

[nas] sleep(1)s in ConnSvr.c



Hi guys,

I'm just wondering about the rationale for the sleep(1) at
ConnSvr.c:895 ConnSvr.c:1060 and ConnSvr.c:1104.

It seems to me that they're all basically pausing after a failed
{UNIX,tcp} socket connection. What I'm wondering is why this is
happening, and also the reasoning behind the retries. Is it expected
that re-trying a failed connection after a second would ever succeed?

Ultimately, I would love to see these sleeps removed (attached patch),
and also the #define AU_CONNECTION_RETRIES 5 at ConnSvr.c:84 set to 0
- is there any likelihood of this happening? My application is pausing
for 5 secs before it can continue if a NAS server is unable to be
contacted.

Thanks!
Kris
--- ConnSvr.c.orig	2008-08-03 01:35:58.000000000 +0100
+++ ConnSvr.c	2008-08-03 01:37:05.000000000 +0100
@@ -892,7 +892,6 @@ static int MakeUNIXSocketConnection (
 
 		return -1;
 	    }
-	    sleep (1);
 	} else {
 	    break;
 	}
@@ -1057,7 +1056,6 @@ static int MakeTCPConnection (
 		errno = olderrno;
 		return -1;
 	    }
-	    sleep (1);
 	} else {
 	    break;
 	}
@@ -1101,7 +1099,6 @@ static int MakeTCPConnection (
 		errno = olderrno;
 		return -1;
 	    }
-	    sleep (1);
 	} else {
 	    break;
 	}