Skip to content

fix(net): the JS subscribe-drop benchmark finishes - #8520

Open
kixelated wants to merge 3 commits into
mainfrom
quest/m0/js-subscribe-drop-hang
Open

kixelated wants to merge 3 commits into
mainfrom
quest/m0/js-subscribe-drop-hang

Conversation

@kixelated

@kixelated kixelated commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

just js bench subscribe-drop hung after its CSV header, stalling Nightly (JS benchmarks) until its 60-minute timeout. Reproduced locally. The hang came from the benchmark, not @moq/net, so no merge-gate test is added:

  • Lite-07 keeps the Subscribe Stream open after SUBSCRIBE_FINISH (moq-dev/moq#7675), and the benchmark waited for the stream to end. It now stops once all groups have dropped.
  • SubscribeDrop.end is exclusive now, but the benchmark still counted it as inclusive (+ 1n).
  • Authored tracks now default to a zero max age (moq-dev/moq#7729), so only the newest group was offered. The track now sets maxAge: null, so all 128 groups drop again.

Local run:

publishers,subscribers,groups,drop_us
1,1,128,1190.84
1,4,128,516.33
1,16,128,215.11
4,1,128,176.09
4,4,128,218.34
4,16,128,188.53
16,1,128,163.54
16,4,128,270.32
16,16,128,569.70

Caused by

  • moq-dev/moq#7675: lite-07 keeps the Subscribe Stream open past SUBSCRIBE_FINISH, and the benchmark waited for its end.
  • moq-dev/moq#7729: authored tracks default to a zero max age, so the benchmark's track offered only its newest group.

Follow-ups

Impact

No public API or wire change; benchmark only.

Checks

just check passes.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, low effort

🤖 Generated with Claude Code

(Written by Opus 5.5)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1ccd0-b89e-7a13-9800-7bd58e7db7a2, round 2
  • Head: 00c8d46
  • Base: origin/main at b1ed1ba
  • Score: 10/10, The changes since the reviewed head only close the completed task and document a performance follow-up, with no new actionable defects or changes to the previously approved implementation.
  • Findings: none

kixelated and others added 2 commits November 11, 2026 13:58
Lite-07 keeps the Subscribe Stream open past SUBSCRIBE_FINISH, so the bench
stops once every group is dropped instead of waiting for the stream's end.
Drops are half-open, and the track keeps every group (maxAge null) so all
of them are offered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The JS subscribe-drop benchmark finishes fix(net): the JS subscribe-drop benchmark finishes Nov 11, 2026
@kixelated
kixelated marked this pull request as ready for review November 11, 2026 22:54
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The subscribe-drop benchmark track now sets maxAge to null. Its response loop stops when the accumulated drop count reaches groups. The loop counts each drop range as end - start; the final check still requires the total to equal groups. The changes also remove a hang note and its related link, and add a note with measurements and an investigation plan for the single-subscriber benchmark.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 00c8d

This change fixes a benchmark hang and updates internal notes. It does not alter public behavior, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(net): the JS subscribe-drop benchmark finishes" names the main change: a fix so the JS subscribe-drop benchmark completes instead of hanging. The changeset stops the response loop after…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description explains the cause of the hang in the JS subscribe-drop benchmark and the fix: stopping after all groups drop, treating SubscribeDrop.end as exclusive, and setting maxAge to null. It a…
Full details: Title check

Explanation

The title "fix(net): the JS subscribe-drop benchmark finishes" names the main change: a fix so the JS subscribe-drop benchmark completes instead of hanging. The changeset stops the response loop after the expected drops, switches the drop count to an exclusive range, and sets maxAge to null on the benchmark track. The title is specific and matches the primary change.

Full details: Description check

Explanation

The description explains the cause of the hang in the JS subscribe-drop benchmark and the fix: stopping after all groups drop, treating SubscribeDrop.end as exclusive, and setting maxAge to null. It also lists local benchmark results and the related follow-up document. The description is directly related to the changeset.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f65851a-2e7e-49e5-9452-3f37e2a1db4e
Commits

Reviewing files that changed from the base of the PR and between 7909937 and 00c8d46.

Files selected for processing: 3

  • quest/m0/js-subscribe-drop-hang.md
  • quest/m0/lite07-compression-bench-hang.md
  • quest/m4/perf/js-subscribe-drop-single.md
Files with no reviewable changes: 2

  • quest/m0/js-subscribe-drop-hang.md
  • quest/m0/lite07-compression-bench-hang.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

…r's drop cost

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • The drop loop stops on accounting, not stream end. js/net/bench/subscribe-drop.ts now reads responses while (dropped < groups) and still throws on dropped !== groups, so an early stream end fails loudly instead of hanging — and it no longer waits for an end lite-07 never sends after SUBSCRIBE_FINISH.
  • Drop ranges count exclusively. end - start matches the documented SubscribeDrop.end ("One past the last dropped group sequence") and the existing gate test at js/net/src/lite/publisher.test.ts:2591-2598, which the new loop mirrors.
  • The track keeps all 128 groups. maxAge: null is the documented JS spelling for unlimited history after authored tracks gained a zero-maxAge default, so the sweep measures failed group sends again rather than a single live-edge group.
  • Quest bookkeeping. Closes quest/m0/js-subscribe-drop-hang.md, drops its back-reference from the compression-bench quest, and files the 1×1 drop-cost question under quest/m4/perf/. No tracked reference to the deleted quest remains, and the perf questline README indexes epics only.

Verified locally: bun js/net/bench/subscribe-drop.ts prints all 9 CSV rows in 32.5 s (exit 0), and bunx tsc --noEmit -p net/bench/tsconfig.json is clean. Absolute timings differ from the author's run (1097 µs vs 1190 µs at 1×1, 183 µs vs 570 µs at 16×16), but the 1×1 outlier reproduces — the shape the follow-up quest targets.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

This branch has not been deployed

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