bneradt commented on code in PR #10688:
URL: https://github.com/apache/trafficserver/pull/10688#discussion_r1376939374


##########
src/iocore/net/UnixNetVConnection.cc:
##########
@@ -1449,6 +1453,28 @@ UnixNetVConnection::remove_from_active_queue()
   }
 }
 
+void
+UnixNetVConnection::enable_inbound_connection_tracking(ConnectionTracker::Group
 *group)
+{
+  ink_assert(nullptr == conn_track_group);
+  conn_track_group = group;
+}
+
+void
+UnixNetVConnection::release_inbound_connection_tracking()
+{
+  // Update upstream connection tracking data if present.
+  if (conn_track_group) {
+    if (conn_track_group->_count >= 0) {
+      (conn_track_group->_count)--;
+      conn_track_group = nullptr;

Review Comment:
   > why does this need to be set to null?
   
   Well, I mostly set to nullptr here because I copied this logic from 
"release_outbound_connection_tracking". :) 
   
   Having said that, a reason to set to nullptr is to avoid decrementing the 
group twice if release_inbound_conenction_tracking is called twice for some 
reason. This is similer to the "free and set to null" pattern.
   
   > if so, why don't we set the group object to null in accept functions when 
it hits client_max and we've hit client throttling
   
   If we hit the max, then we do not set conn_track_group via 
enable_inbound_connection_tracking. So it will be null.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to