Skip to content

feat(quic): wire experimental QUIC client ALPN accessor and live byte/packet stats#1164

Open
kcenon wants to merge 1 commit into
developfrom
feat/issue-1158-quic-client-stats-alpn
Open

feat(quic): wire experimental QUIC client ALPN accessor and live byte/packet stats#1164
kcenon wants to merge 1 commit into
developfrom
feat/issue-1158-quic-client-stats-alpn

Conversation

@kcenon
Copy link
Copy Markdown
Owner

@kcenon kcenon commented May 31, 2026

Refs #1158 (partial)

Summary

Wires the two experimental-client accessors that returned placeholder values:

  • messaging_quic_client::alpn_protocol() returns the protocol negotiated during the handshake via the new quic_socket::negotiated_alpn() (delegates to quic_crypto::get_alpn()), or std::nullopt when none negotiated.
  • messaging_quic_client::stats() reports live bytes_sent/bytes_received/packets_sent/packets_received from quic_socket, which now counts datagrams on its send (send_packet) and receive (do_receive) paths.

Scope limitation (why this is "Refs" not "Closes")

packets_lost, smoothed_rtt, min_rtt, and cwnd remain zero. The issue assumed the loss detector / RTT estimator / congestion controller were reachable, but there is no quic_connection aggregator and those components are not integrated into the experimental client's quic_socket. Surfacing live values for them requires integrating the QUIC recovery stack — out of scope for this accessor-wiring issue. stats() is therefore kept experimental; #1158 stays open for the recovery-stack follow-up.

Test Plan

  • New QuicSocketStatsAccessorsTest: counters start at zero and ConnectIncrementsSentCounters confirms they advance after connect() emits the Initial packet; ALPN starts empty.
  • Existing client before-connect tests (StatsBeforeConnect, AlpnProtocolBeforeConnectReturnsNone) still pass.
  • Local ci-standalone build: network_experimental_quic_client_test 22/22 pass.

Notes

  • docs/PROTOCOL_SUPPORT.md: ALPN row → production; stats row documented as partially wired (experimental); QUIC follow-up bullet rescoped to recovery-stack integration.
  • Pre-existing, unrelated: QuicSocketHermeticTransportTest (4) and 2 QuicSocketHermeticTest cases fail locally (loopback datagram capture unsupported in this env) — verified identical on clean develop. Separately, a messaging_quic_client connect-then-stop path segfaults during shutdown (pre-existing lifecycle bug, not touched here); tests deliberately drive quic_socket directly to avoid it.

…tats

Wire the two experimental-client accessors that were returning placeholder
values to the underlying quic_socket:

- alpn_protocol() now returns the protocol negotiated during the handshake
  via the new quic_socket::negotiated_alpn() (delegating to quic_crypto::
  get_alpn()), or nullopt when none was negotiated.
- stats() now reports live bytes_sent/bytes_received/packets_sent/
  packets_received from quic_socket, which counts datagrams on its send and
  receive paths.

packets_lost, smoothed_rtt, min_rtt, and cwnd remain zero: those require the
QUIC loss-detection / RTT-estimation / congestion-control stack, which is not
integrated into the experimental client's socket. stats() is therefore kept
experimental and the recovery-stack integration is tracked as a follow-up.

Tests drive quic_socket directly: counters start at zero and advance after a
connect() emits the Initial packet; ALPN starts empty. docs/PROTOCOL_SUPPORT.md
flips the ALPN row to production and documents the partial stats wiring.

Refs #1158
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 70.9%
Branch Coverage 35.4%
Target 80% lines / 70% branches
Coverage Details

Full HTML report is available as a build artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant