bryancall commented on PR #13957:
URL: https://github.com/apache/trafficserver/pull/13957#issuecomment-6745260904

   ❌ **Request changes**
   
   Thanks for picking this up, and sorry for the wait. To your question: 
Brian's comment on 4 Nov only restarted a CI job, so nothing from him is 
outstanding. What I'd like changed is below.
   
   ## Verified: the lock changes are safe
   
   Every write to the exempt list updates `has_client_exempt_entries` while 
holding the exclusive lock, and the list itself is still only read under the 
shared lock, so the relaxed load is fine. A stale value only means one accept 
takes the old locked path, or misses a range added at that same instant, which 
could already happen before. I built this with AddressSanitizer and ran the 
`test_net` unit tests plus the per client connection, connection throttle 
exempt and traffic_ctl Uranium tests. All of them pass.
   
   ## Blocking: a limit set at runtime no longer counts open connections
   
   `proxy.config.net.per_client.max_connections_in` is reloadable. Before this 
change every client connection was tracked even at 0, so turning the limit on 
at runtime counted the connections that were already open. Now 
([NetHandler.cc#L757](https://github.com/apache/trafficserver/blob/716c2365cf7aff0f73c89fe5e4be10a9495aea8e/src/iocore/net/NetHandler.cc#L757))
 a connection accepted while the setting is 0 has no tracker group, so a client 
holding 500 connections when someone sets the limit to 100 can open 100 more 
until the old ones close. Setting it at runtime against one busy client is the 
usual reason to reload it. I think the trade-off is worth it, but please say so 
in the [setting's 
docs](https://github.com/apache/trafficserver/blob/716c2365cf7aff0f73c89fe5e4be10a9495aea8e/doc/admin-guide/files/records.yaml.en.rst#L546-L555):
 a limit raised from 0 at runtime only counts connections accepted after the 
change.
   
   ## Blocking: the inbound tracking output is empty by default
   
   With the limit at 0, `get_connection_tracker_info` with `table: inbound` now 
always returns an empty list, and 
`proxy.process.net.connection_tracker_table_size` no longer counts clients. 
#13890 named this trade-off. Please add a line to the [JSONRPC 
docs](https://github.com/apache/trafficserver/blob/716c2365cf7aff0f73c89fe5e4be10a9495aea8e/doc/developer-guide/jsonrpc/jsonrpc-api.en.rst#L2081)
 saying the inbound table only lists clients while the per client limit is set, 
and mention both changes in the PR description.
   
   ## Blocking: a test for the main change
   
   Nothing fails today if `get_per_client_max_connections_in()` goes back to 
returning `INT32_MAX - 1`. A Uranium case that keeps the default limit, holds 
one client connection open and checks that `get_connection_tracker_info` 
reports an empty inbound table would pin it. With a limit of 3 the same check 
lists the client, so it tells the two cases apart. 
[test_traffic_ctl_server_output.py](https://github.com/apache/trafficserver/blob/716c2365cf7aff0f73c89fe5e4be10a9495aea8e/tests/uranium_tests/traffic_ctl/test_traffic_ctl_server_output.py#L82-L84)
 already reads that table.
   
   ## Non-blocking: the flag's comment
   
   The comment on 
[has_client_exempt_entries](https://github.com/apache/trafficserver/blob/716c2365cf7aff0f73c89fe5e4be10a9495aea8e/include/iocore/net/ConnectionTracker.h#L151)
 restates the name. Saying why it exists, and that every writer updates it 
under `client_exempt_list_mutex`, would help the next person who adds a writer 
keep it in sync.
   
   The URTest 3of3 check has sat at pending since 4 Nov. That is on our CI 
side, not yours.


-- 
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