Skip to content

Don't warn on Alive::drop if aborted - #2580

Merged
kixelated merged 6 commits into
moq-dev:mainfrom
koubaa:drop-abort-no-warn
Aug 3, 2026
Merged

Don't warn on Alive::drop if aborted#2580
kixelated merged 6 commits into
moq-dev:mainfrom
koubaa:drop-abort-no-warn

Conversation

@koubaa

@koubaa koubaa commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Alive::drop warns if a producer didn't finish with either finish() or abort(). The warning says "track::Producer drooped without finish() or abort()"... but it doesn't catch the case when abort() is set, since abort() doesn't set final_sequence.

The code is mostly self-explanatory but comments were included anyways. I could remove them if asked.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @koubaa, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec7a27ad-3122-49a0-85f2-009c25f13860

📥 Commits

Reviewing files that changed from the base of the PR and between b7275ee and 9ec14cf.

📒 Files selected for processing (3)
  • rs/CLAUDE.md
  • rs/justfile
  • rs/moq-net/src/model/track.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • rs/moq-net/src/model/track.rs

Walkthrough

group::Alive::drop and track::Alive::drop now check terminal state before cleanup and after acquiring mutable state. Aborted or finished producers do not emit unfinished-drop warnings. Unfinished producers still release cleanup state and emit warnings. Tests add temporary tracing subscribers and verify both aborted and unfinished producer drop behavior. Loom guidance now describes concurrency model checking and separate build artifacts.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: suppressing Alive::drop warnings for aborted producers.
Description check ✅ Passed The description explains why aborted producers should not trigger an Alive::drop warning and matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

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

Comment @coderabbitai help to get the list of available commands.

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

🧹 Nitpick comments (1)
rs/moq-net/src/model/group.rs (1)

818-866: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use one shared warning-capture helper.

Both test modules add the same tracing Subscriber implementation. Keep one test-only helper and pass the expected warning message.

  • rs/moq-net/src/model/group.rs#L818-L866: replace the local helper with the shared helper.
  • rs/moq-net/src/model/track.rs#L2756-L2805: replace the local helper with the shared helper.

As per coding guidelines, "Refactor awkward internal shapes while making changes ... avoid duplicated one-off helpers."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rs/moq-net/src/model/group.rs` around lines 818 - 866, Introduce one shared
test-only tracing warning-capture helper that accepts the expected warning
message, then replace the duplicated local Subscriber-based helpers in
rs/moq-net/src/model/group.rs:818-866 and
rs/moq-net/src/model/track.rs:2756-2805 with calls to it. Preserve each test’s
existing warning-counting behavior while removing both local helper
implementations.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@rs/moq-net/src/model/group.rs`:
- Around line 818-866: Introduce one shared test-only tracing warning-capture
helper that accepts the expected warning message, then replace the duplicated
local Subscriber-based helpers in rs/moq-net/src/model/group.rs:818-866 and
rs/moq-net/src/model/track.rs:2756-2805 with calls to it. Preserve each test’s
existing warning-counting behavior while removing both local helper
implementations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6fd41575-0295-4a51-941b-c27ea178de65

📥 Commits

Reviewing files that changed from the base of the PR and between 4b6f667 and 8fac137.

📒 Files selected for processing (2)
  • rs/moq-net/src/model/group.rs
  • rs/moq-net/src/model/track.rs

Comment thread rs/moq-net/src/model/group.rs Outdated
@kixelated

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fac137f45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-net/src/model/track.rs Outdated
Comment on lines +2756 to +2758
/// Count `track::Producer` unfinished-drop WARN events while running `f`.
/// Uses only the existing `tracing` dependency (no tracing-subscriber).
fn count_drop_warnings(f: impl FnOnce()) -> usize {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Consolidate the duplicated warning counter

Move this warning-counting subscriber into a shared test helper and pass the expected message as an argument. This implementation duplicates nearly the entire helper added in group.rs, so future tracing or matching fixes must be kept synchronized across two copies, contrary to the repository's requirement to generalize helpers instead of copying them.

AGENTS.md reference: AGENTS.md:L104-L110

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did this in a separate commit in case this is a "isolation is more important than deduplication" codebase.

Comment thread rs/moq-net/src/model/track.rs Outdated

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rs/moq-net/src/model/test_tracing.rs`:
- Around line 41-44: Update Count::enabled to accept only metadata whose level
is exactly Level::WARN, rather than using an ordering comparison that also
enables ERROR events. Leave the rest of the Subscriber implementation unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8d661c6-ff20-4528-9481-20c002abdc84

📥 Commits

Reviewing files that changed from the base of the PR and between 8fac137 and 88ae294.

📒 Files selected for processing (4)
  • rs/moq-net/src/model/group.rs
  • rs/moq-net/src/model/mod.rs
  • rs/moq-net/src/model/test_tracing.rs
  • rs/moq-net/src/model/track.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • rs/moq-net/src/model/track.rs

Comment thread rs/moq-net/src/model/test_tracing.rs
koubaa and others added 3 commits August 2, 2026 21:16
CI failed on import ordering in group.rs and test_tracing.rs. Also
match Level::WARN exactly so ERROR events are not counted.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Codex <codex@openai.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ec14cf3a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/CLAUDE.md
Run the matching recipe by hand when you touch this code, and if you can't (no such host), say plainly in the PR that it's uncompiled rather than implying CI covered it.

- **`just rs loom` is a manual gate. Run it by hand whenever you touch kio's refcount/waiter plumbing (`lock.rs`, `producer.rs`, `consumer.rs`, `weak.rs`, `waiter.rs`) or moq-net's model layer (`model/`), and mention the result in the PR.** Nothing else will run it: `--cfg loom` swaps kio's Mutex/atomics for loom's instrumented ones, which rebuilds the whole dependency tree and can't share artifacts with a normal `cargo test`, so it's deliberately outside `check`/`ci`. Budget about a minute of model checking on top of that build. The search is exhaustive on purpose, so don't reach for `preemption_bound` to speed it up; the recipe already buys the speed back with `--release`, which matters here because a model check reruns the body once per interleaving.
- **`just rs loom` model-checks concurrent handoffs in kio and moq-net.** It stays outside `check`/`ci`: `--cfg loom` swaps kio's Mutex/atomics for loom's instrumented ones, which rebuilds the whole dependency tree and can't share artifacts with a normal `cargo test`. Use it when developing or diagnosing concurrent handoffs. Budget about a minute of model checking on top of that build. The search is exhaustive on purpose, so don't reach for `preemption_bound` to speed it up; the recipe already buys the speed back with `--release`, which matters here because a model check reruns the body once per interleaving.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the mandatory loom gate

Restore the requirement to run just rs loom for changes to kio refcount/waiter plumbing or moq-net's model layer. This replacement makes the model checker optional even though the rs/justfile recipe remains outside both check and ci, so future concurrent-handoff changes can follow the documented workflow without running the repository's only exhaustive race check. (Written by GPT-5.6 Sol)

Useful? React with 👍 / 👎.

@kixelated
kixelated enabled auto-merge (squash) August 3, 2026 17:53
@kixelated
kixelated merged commit 26d060a into moq-dev:main Aug 3, 2026
1 check passed
@moq-bot moq-bot Bot mentioned this pull request Aug 3, 2026
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.

2 participants