bneradt commented on PR #13606: URL: https://github.com/apache/trafficserver/pull/13606#issuecomment-6609766378
Thanks for tracing all of this, @cmcfarlen. Note that the original commit here had already reached master inside #13545, so after the rebase this PR consists only of the follow-up for your review (9d0b3890dd). **Failed attempt throttling its retry.** Fixed. `ConnectingEntry::release_outbound_connection_tracking()` mirrors the `PoolableSession` helper. It now runs right after `remove_entry()` in the error branch, before any queued SM is dispatched, and the destructor still calls it as a backstop. The new urtest `origin_connection/test_per_server_connect_retry.py` pins this: `per_server.connection.max: 1`, `connect_attempts_max_retries: 2`, origin port closed. With the fix the client gets a 502, `blocked_connection` and `origin_connections_throttled_out` stay at 0, and `current_connection` returns to 0. With the early release removed, the same test gets the 503 throttle response. **Certificate-validation path.** Fixed. For a multiplexed session, every queued SM is now validated before any is dispatched. If none accepts the certificate, the entry releases the reservation itself and never hands it to the session, so the `CONNECT_EVENT_DIRECT` retries don't race the deferred `Http2ServerSession::destroy()`. If at least one accepts, the reservation moves to the session, which is the right accounting: that connection is live while the rejected SMs open their own. A side benefit is that validation no longer reads `new_session->get_netvc()` after earlier SMs have already been handed the session. **Creator-only configuration.** I kept this as a deliberate limitation and documented it. The header comment on `enable_outbound_connection_tracking()` and the `per_server.connection.max` entry in `records.yaml.en.rst` now say that a coalesced connection is counted once, under the creating transaction's group and configuration. Charging joiners as well would double-count a single socket, and the joiners already matched on hostname/SNI/cert to share the entry. **Smaller items.** - The invariant is now named in the comment on `_transfer_outbound_connection_tracking()`: the creator moved its reservation into the entry, and joiners queue in `add_to_existing_request()` before reserving, so the session has no group yet. - The `HttpSM` call site now guards with `is_active()`, matching `create_server_session()`. - Named release helper added as described above. - Tests: the urtest above, plus a Catch2 case confirming that the helper releases once and the later destructor does not release again. -- 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]
