]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Always verify that the client is fully reachable before talking
authorNickolai Zeldovich <kolya@mit.edu>
Thu, 22 Aug 2002 02:47:44 +0000 (02:47 +0000)
committerGarry Zacheiss <zacheiss@mit.edu>
Thu, 22 Aug 2002 02:47:44 +0000 (02:47 +0000)
to it, in the fileserver.  This prevents some additional lossage
cases with poorly-connected clients.

Disable same feature for other Rx services, since they don't
need to incur extra RTT delay.

(cherry picked from commit feb689396ccc39f304db05cb69dc8db3506de921)

src/rx/rx.c
src/rx/rx.h
src/viced/viced.c

index 7a8243d854b083a266adbf114975a822223f11eb..72ed2f01e0663db091cdd1630267969b08480d30 100644 (file)
@@ -1248,6 +1248,7 @@ rx_NewService(port, serviceId, serviceName, securityObjects,
            service->idleDeadTime = 60;
            service->connDeadTime = rx_connDeadTime;
            service->executeRequestProc = serviceProc;
+           service->checkReach = 0;
            rx_services[i] = service;   /* not visible until now */
            AFS_RXGUNLOCK();
            USERPRI;
@@ -2919,12 +2920,8 @@ static int rxi_CheckConnReach(conn, call)
     struct rx_peer *peer = conn->peer;
     afs_uint32 now, lastReach;
 
-    MUTEX_ENTER(&rx_serverPool_lock);
-    if (service->nRequestsRunning <= service->maxProcs/2) {
-       MUTEX_EXIT(&rx_serverPool_lock);
+    if (service->checkReach == 0)
        return 0;
-    }
-    MUTEX_EXIT(&rx_serverPool_lock);
 
     now = clock_Sec();
     MUTEX_ENTER(&peer->peer_lock);
index b3305652282df0bbdc8bf87bc72521c97f935f5c..8cadf0b7c63a5f704cca52e1eacd3f0a501b3246 100644 (file)
@@ -204,6 +204,9 @@ int ntoh_syserr_conv(int error);
 /* Set the connection dead time for any connections created for this service (server only) */
 #define rx_SetServiceDeadTime(service, seconds) ((service)->secondsUntilDead = (seconds))
 
+/* Enable or disable asymmetric client checking for a service */
+#define rx_SetCheckReach(service, x) ((service)->checkReach = (x))
+
 /* Set connection dead time, for a specific client or server connection */
 extern void rx_SetConnDeadTime();
 
@@ -346,6 +349,7 @@ struct rx_service {
     u_short minProcs;              /* Minimum # of requests guaranteed executable simultaneously */
     u_short connDeadTime;                  /* Seconds until a client of this service will be declared dead, if it is not responding */
     u_short idleDeadTime;                  /* Time a server will wait for I/O to start up again */
+    u_char checkReach;             /* Check for asymmetric clients? */
 };
 
 #endif /* KDUMP_RX_LOCK */
index d2c8ef1d7cb86e5f6bd9fbe8fcb48f8a80945e6a..ec254109303884b2539f453a99224bd234c9fcb6 100644 (file)
@@ -488,6 +488,7 @@ main(argc, argv)
     rx_SetDestroyConnProc(tservice, (char (*)()) h_FreeConnection);
     rx_SetMinProcs(tservice, 3);
     rx_SetMaxProcs(tservice, lwps);
+    rx_SetCheckReach(tservice, 1);
 
     tservice = rx_NewService(0,  RX_STATS_SERVICE_ID, "rpcstats", sc, 4, RXSTATS_ExecuteRequest);
     if (!tservice) {