Skip to content

test(drill): subscriber-leaks-broadcasts removes the session end's source close too - #9292

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/nightly/drill-leak-sensitivity
Nov 21, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/nightly/drill-leak-sensitivity

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Nightly's Tests (test drill-sensitivity) job failed in run 44767045952. cancel_under_backpressure_releases_the_reader::loopback still passed with subscriber-leaks-broadcasts applied, so the drill was no longer checking that release.

Summary

#9219 made a subscribing session close its sources directly when the session ends:

  • SubscriberDriver::abort closes every source in its task set.
  • TrackServe::close_if_ending closes a run's source before the session's end fails that run.

The mutation only leaked the SourceGuards and the Announced routes by wrapping them in ManuallyDrop. The new direct close still released the cancelled reader's broadcast, so the drill passed. The patch now removes both direct closes as well, and the drill catches the missing release again. The drill itself is unchanged.

This finishes quest/m0/nightly/drill-leak-sensitivity.md and deletes the quest file.

Choices for review

  • The patch also removes the close in SubscriberDriver::abort, even though this drill only depends on close_if_ending. With the leaks applied, removing only close_if_ending makes the drill fail, while removing only the abort loop does not. I kept the abort hunk so the mutation removes every release that runs when a session ends. That way the drill stays sensitive if its path later moves to the driver's abort. The alternative is to drop that hunk for a smaller patch.

Validation

I applied the mutation in place on this branch and ran the drill with nextest:

  • Old patch (the leaks only): the drill passes, which reproduces the Nightly failure.
  • Old patch with the abort loop removed: the drill passes.
  • Old patch with close_if_ending turned into a no-op: the drill fails with the cancelled subscriber's broadcast never closed.
  • close_if_ending as a no-op without the ManuallyDrop leaks: the drill passes, so the leaks are still needed.
  • TMPDIR=.tmp test/drill/sensitivity.sh subscriber-leaks-broadcasts: the unmutated baseline passes, and the mutated run reports sensitive: ... fails with 'the cancelled subscriber's broadcast never closed'.
  • sensitivity.sh --apply-only: all 11 mutations apply.

Caused by

  • moq-dev/moq#9219 - added a direct source close when a session ends, but did not extend the mutation that removes that release (found by check: Nightly drill-sensitivity)

Impact

Public API: none. Wire: none. Only a test patch file changes.

Follow-ups

None.

Models

Size: S
Implementer: Claude, claude-opus-5-5, medium effort (arm A)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: a114477

  • Base: origin/main at c6727f2

  • Risk: low, Only a test mutation fixture and a quest plan change, so any break affects contributors running the leak-sensitivity drill, and a revert fully undoes it.

  • Classified: low by Codex, gpt-6.1-sol, low effort, session 01a1fca8-6dd6-7730-959d-1ac38ffd928a

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1fca8-82f8-73c3-b9b3-f7daac878bd1, round 1

  • Score: 9/10, Source inspection found no defects and the mutation matches the intended failure scenario, but tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 20, 2026 21:41
… source close

#9219 made a subscribing session close its sources outright when it ends,
so leaking the guards alone no longer kept the cancelled reader's
broadcast open. The mutation now removes those closes too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The drill catches a subscriber that leaks broadcasts again test(drill): subscriber-leaks-broadcasts removes the session end's source close too Nov 21, 2026
@kixelated
kixelated marked this pull request as ready for review November 21, 2026 05:51
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 0c864b21-d7f2-48e6-b6b4-66dc6f16a644
Commits

Reviewing files that changed from the base of the PR and between c6727f2 and a114477.

Files selected for processing: 2

  • quest/m0/nightly/drill-leak-sensitivity.md
  • test/drill/mutations/subscriber-leaks-broadcasts.patch
  • 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

@kixelated
kixelated enabled auto-merge November 21, 2026 05:52

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

Approach: sound. #9219 added two direct SourceGuard closes on session end, which made the ManuallyDrop leaks harmless. Removing those closes inside the mutation fixes the cause and leaves the drill as it was.

Reviewed changes

I reviewed both commits: the mutation patch and the deletion of the quest file.

  • subscriber-leaks-broadcasts.patch: the patch now also removes the source.source.close() loop in SubscriberDriver::abort and empties TrackServe::close_if_ending. The old hunk offsets are rebased onto current main, and the header comment explains why every release must go.
  • Quest file: quest/m0/nightly/drill-leak-sensitivity.md is deleted now that the work is done.

What I checked:

  • git apply --check applies the patch cleanly to this tree.
  • The mutation leaves no dead code that would add warnings. self.sources is still polled in poll_drain, and poll_ending still has other callers.
  • The subscriber-leaks-broadcasts row in test/drill/README.md still describes the mutation correctly.

Keeping the abort hunk is the right call. With it, the mutation removes every release that runs at session end, so the drill stays sensitive if a later refactor moves the release into the driver.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 7de1df9 Nov 21, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m0/nightly/drill-leak-sensitivity branch November 21, 2026 05:57
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