trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: Fix per origin connection throttling to include the current count and limit.
Date Thu, 29 Mar 2018 14:06:11 GMT
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6c6f684  Fix per origin connection throttling to include the current count and limit.
6c6f684 is described below

commit 6c6f6842172e9a8218a53c2aa6c467f9e0750ac6
Author: Alan M. Carroll <amc@apache.org>
AuthorDate: Wed Mar 28 13:05:36 2018 -0500

    Fix per origin connection throttling to include the current count and limit.
---
 proxy/http/HttpSM.cc | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 1461866..a61e036 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4869,15 +4869,17 @@ HttpSM::do_http_server_open(bool raw)
 
     CryptoHash hostname_hash;
     CryptoContext().hash_immediate(hostname_hash, static_cast<const void *>(t_state.current.server->name),
-                                   strlen(t_state.current.server->name));
+                                   static_cast<int>(strlen(t_state.current.server->name)));
 
-    if (connections->getCount(t_state.current.server->dst_addr, hostname_hash,
-                              (TSServerSessionSharingMatchType)t_state.txn_conf->server_session_sharing_match)
>=
-        t_state.txn_conf->origin_max_connections) {
+    auto ccount = connections->getCount(t_state.current.server->dst_addr, hostname_hash,
+                                        (TSServerSessionSharingMatchType)t_state.txn_conf->server_session_sharing_match);
+    if (ccount >= t_state.txn_conf->origin_max_connections) {
       ip_port_text_buffer addrbuf;
       ats_ip_nptop(&t_state.current.server->dst_addr.sa, addrbuf, sizeof(addrbuf));
-      SMDebug("http", "[%" PRId64 "] over the number of connection for this host: %s", sm_id,
addrbuf);
-      Warning("[%" PRId64 "] over the max number of connections for this host: %s", sm_id,
addrbuf);
+      SMDebug("http", "[%" PRId64 "] too many connections (%d) for this host (%" PRId64 "):
%s", sm_id, ccount,
+              t_state.txn_conf->origin_max_connections, addrbuf);
+      Warning("[%" PRId64 "] too many connections (%d) for this host (%" PRId64 "): %s",
sm_id, ccount,
+              t_state.txn_conf->origin_max_connections, addrbuf);
       ink_assert(pending_action == nullptr);
 
       // if we were previously queued, or the queue is disabled-- just reschedule

-- 
To stop receiving notification emails like this one, please contact
amc@apache.org.

Mime
View raw message