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


##########
src/iocore/net/UnixNetAccept.cc:
##########
@@ -82,10 +83,29 @@ net_accept(NetAccept *na, void *ep, bool blockable)
     }
     Metrics::increment(net_rsb.tcp_accept);
 
+    int const client_max = NetHandler::get_per_client_max_connections_in();
+    std::shared_ptr<ConnectionTracker::Group> conn_track_group;
+    if (client_max > 0) {
+      auto inbound_tracker     = ConnectionTracker::obtain_inbound(con.addr);
+      auto const tracked_count = inbound_tracker.reserve();
+      if (tracked_count > client_max) {
+        // close the connection as we are in per client connection throttle 
state
+        inbound_tracker.release();

Review Comment:
   Shouldn't the `release` be *after* the uses?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to