From: Derrick Brashear Date: Sun, 28 Aug 2005 21:43:36 +0000 (+0000) Subject: STABLE14-fix-busyat-enforcement-20050819 X-Git-Tag: openafs-stable-1_4_0-rc2~2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c545a8d5051d57ecaae5c195ce29c402516b883c;p=packages%2Fo%2Fopenafs.git STABLE14-fix-busyat-enforcement-20050819 FIXES 20659 enforce busyat in the other half of the if (cherry picked from commit aec3c2b19292c552705f1c0eb3065a26e0b03649) --- diff --git a/src/rx/rx.c b/src/rx/rx.c index 018d00362..fcbcb97f3 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -2602,6 +2602,24 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket, clock_GetTime(&call->queueTime); hzero(call->bytesSent); hzero(call->bytesRcvd); + /* + * If the number of queued calls exceeds the overload + * threshold then abort this call. + */ + if ((rx_BusyThreshold > 0) && (rx_nWaiting > rx_BusyThreshold)) { + struct rx_packet *tp; + + rxi_CallError(call, rx_BusyError); + tp = rxi_SendCallAbort(call, np, 1, 0); + MUTEX_EXIT(&call->lock); + MUTEX_ENTER(&conn->conn_data_lock); + conn->refCount--; + MUTEX_EXIT(&conn->conn_data_lock); + MUTEX_ENTER(&rx_stats_mutex); + rx_stats.nBusies++; + MUTEX_EXIT(&rx_stats_mutex); + return tp; + } rxi_KeepAliveOn(call); } else if (np->header.callNumber != currentCallNumber) { /* Wait until the transmit queue is idle before deciding