Skip to content

Fix/perf client segfault - #217

Closed
peterchave wants to merge 469 commits into
facebookexperimental:mainfrom
openmoq:fix/perf_client_sf
Closed

Fix/perf client segfault#217
peterchave wants to merge 469 commits into
facebookexperimental:mainfrom
openmoq:fix/perf_client_sf

Conversation

@peterchave

Copy link
Copy Markdown
Contributor

Here is the proposed fix for the perf client crash for review.

afrind and others added 30 commits May 4, 2026 14:01
The hardcoded limit of 100 simultaneous QUIC connections was a leftover
default that blocks production deployments with more concurrent clients.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds point-in-time samples (smoothedRttUs, receiveBytesPerSec,
bytesInTransit) to PathQualityDelta and enables path quality change
callbacks via picoquic_default_quality_update so callers receive
the event when pacing rate or RTT shifts meaningfully.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sync: openmoq/picoquic pin to 8c14cc449afc
sync: openmoq/picoquic pin to 0c516acd3b57
sync: openmoq/picoquic pin to ee6f0b1fb491
Add onPacketsSent(n) and onPacketsReceived(n) to PicoQuicStatsCallback
with default no-op implementations. Bump them from PicoQuicSocketHandler:
- drainOutgoing() calls onPacketsSent with total packets sent per drain pass
- onNotifyDataAvailable() calls onPacketsReceived with recvmmsg batch total

Wire the callback into PicoQuicSocketHandler via setStatsCallback(), called
from MoQPicoQuicEventBaseServer::start() using a new protected
statsCallbackRaw() accessor on MoQPicoServerBase.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sync: openmoq/picoquic pin to 6e8a5261db61
sync: openmoq/picoquic pin to 5e4c01dd72cd
sync: openmoq/picoquic pin to 83a8e0d5f12b
…TER tests

Two MoQFramerV16PlusTest cases (SubscribeNamespaceWithTrackFilter,
TrackFilterLargeValues) asserted SUBSCRIBE_NAMESPACE wire type 0x50.
That value is draft 18+ per draft-ietf-moq-transport-18 section 10.18;
draft 16 (the only version this suite is instantiated for) uses 0x11
(LEGACY_SUBSCRIBE_NAMESPACE) per draft-ietf-moq-transport-16 section
9.25.

MoQFrameWriter::writeSubscribeNamespace already branches on
majorVersion >= 18 to emit the correct wire type, so the writer was
spec-compliant; the test expectation was stale relative to the v18
wire-type renumber introduced upstream by b07c680.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
sync: openmoq/picoquic pin to 8e9d619d9014
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
omoq-sync-bot Bot and others added 28 commits July 31, 2026 07:24
sync: openmoq/picoquic pin to cb82e2aaf3e1
sync: openmoq/picoquic pin to 02b5452b6ec7
Summary: fMP4 parse into a per-track Fmp4Track; the static single-object CatalogSource (catalog served as a track); the prefix-routed FileMediaSourceResolver.

Reviewed By: kvtsoy

Differential Revision: D113852924

fbshipit-source-id: 130da6de1a870edefc2a036930a7360447ec2fd4
Summary: Drain a SegmentSource into a MoQForwarder - subgroup/stream mapping, BLOCKED backpressure, cancellable teardown.

Reviewed By: kvtsoy

Differential Revision: D113852925

fbshipit-source-id: b57541ae16df3469b28a4140a2695cee1b32afdd
Summary:
# Context
Endpoint resolution lived in `MoQClientBase` before transport selection, forcing every client path through `folly::SocketAddress` and preventing mobile QUIC from supplying asynchronous DNS.

# This Diff
Moves endpoint resolution into the QUIC-specific connect implementations. `MoQClientBase` retains URL and deadline orchestration, while each QUIC client owns the address type and resolution strategy it needs. TCP/QMUX behavior is unchanged.

# This Stack
1. [NFC] Avoid copies in client test callbacks.
2. **Move endpoint resolution behind QUIC client implementations.**
3. Add the singular async QUIC address seam and deadline accounting.
4. Adapt MNS DNS to the QUIC endpoint contract.
5. Test the MNS QUIC DNS adapter.
6. Inject MNS DNS into TigonMoQ on Android.
7. Add detached event-loop shutdown.
8. Avoid blocking Android runtime destruction during system DNS.

Reviewed By: kvtsoy

Differential Revision: D114627471

fbshipit-source-id: cba4130b8052eca7d01e1e72a3e5b49197aea637
Summary:
# Context
Synchronous URL resolution blocks the mobile moxygen event loop and cannot participate in coroutine cancellation or the connection deadline supplied by the caller. The resolver seam must remain source-compatible until production clients inject a resolver later in the stack.

# This Diff
Adds the singular `MoQQuicAddressResolver` coroutine seam returning the owning `quic::SocketAddress` used by mvfst on each platform. When a resolver is supplied, `MoQClientMobile` applies a caller-side timeout that cancels the returned task, preserves structured cancellation, and charges DNS plus QUIC setup to the existing end-to-end deadline.

Omitting the resolver preserves the existing synchronous fallback so this commit and standalone callers remain independently buildable. The mobile text client resolves during CLI startup, before running its event loop, and injects that pre-resolved endpoint explicitly.

Because mvfst receives a bare IP, `setHostname(url_.getHost())` preserves the original host for TLS/SNI and matches the desktop path. `QuicConnectCB::onTransportReady` also returns after reporting cancellation, fixing a pre-existing second completion of the promise.

# This Stack
1. [NFC] Avoid copies in client test callbacks.
2. Move endpoint resolution behind QUIC client implementations.
3. **Add the singular async QUIC address seam and deadline accounting.**
4. Adapt MNS DNS to the QUIC endpoint contract.
5. Test the MNS QUIC DNS adapter.
6. Inject MNS DNS into TigonMoQ on Android and remove the fallback.
7. Add detached event-loop shutdown.
8. Avoid blocking Android runtime destruction during system DNS.

Reviewed By: JunqiWang

Differential Revision: D114613259

fbshipit-source-id: c7c0e96886fdc6b0767647e75678d47c67bade8b
Summary:
# Context
The preceding async resolver seam remains optional for source compatibility. Android must create an MNS resolver with the correct event-loop lifetime, inject it into TigonMoQ, and prevent production clients from silently falling back to blocking DNS.

# This Diff
Makes `MoQClientMobile` and `TigonMoQClient` require a non-null address resolver and removes the synchronous fallback. The Android runtime creates an MNS DNS resolver on its event loop, wraps and injects it through the QUIC resolver seam, and drains it during loop-owned shutdown.

Client tests cover DNS errors and distinguish caller cancellation as `folly::OperationCancelled` from deadline expiry as `folly::FutureTimeout`; malformed MNS output is covered by the adapter tests earlier in the stack. The client target uses Folly shared test main because these timeout paths require `folly::Init` to register the Timekeeper singleton.

# This Stack
1. [NFC] Avoid copies in client test callbacks.
2. Move endpoint resolution behind QUIC client implementations.
3. Add the singular async QUIC address seam and deadline accounting.
4. Adapt MNS DNS to the QUIC endpoint contract.
5. Test the MNS QUIC DNS adapter.
6. **Inject MNS DNS into TigonMoQ on Android and remove the fallback.**
7. Add detached event-loop shutdown.
8. Avoid blocking Android runtime destruction during system DNS.

Reviewed By: JunqiWang

Differential Revision: D114613258

fbshipit-source-id: dc8dedce7209de6bb8a96866c54f95c84fcafcc1
Summary:
Make `MoQExecutor` a typealias for `quic::QuicExecutor`

___

Differential Revision: D114163978

fbshipit-source-id: 6ca671a8dbf7d9d1c9548729a65244056b01743e
Upstream changed moxygen::MoQExecutor from a class to
`using MoQExecutor = quic::QuicExecutor`, so the forward declaration in
MoQPicoServerBase.h now conflicts with the alias. Include
moxygen/events/MoQExecutor.h instead of forward declaring it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- install-system-deps.sh: dispatch on ID_LIKE when ID is not a known
  distro, so Ubuntu/Debian derivatives (Linux Mint, Pop!_OS, LMDE) and
  RHEL derivatives (Rocky, Alma) install deps instead of erroring out.
- omoq-ci-main.yml: add ubuntu-24.04-amd64 to the publish matrix so the
  snapshot release covers the current Ubuntu LTS; the release job picks
  it up automatically (downloads all artifacts).
- omoq-dev-build.yml: add ubuntu-24.04-amd64 target for parity with the
  publish matrix.
Consumers of the installed tree (e.g. moqx) locate GoogleTest with
find_package(GTest REQUIRED CONFIG). The system-googletest probe used
module mode, so a googletest visible only to FindGTest.cmake (libs and
headers without a cmake package config) short-circuited the
FetchContent bundling and produced an install tree those consumers
cannot configure against. Require CONFIG in the probe so bundling is
skipped only when a config-mode googletest is genuinely available.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 19, 2026
@peterchave peterchave closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants