Quiet expected teardown logs and lock capability reads - #4010
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe changes synchronize external capability access across registries and orchestrators. They also classify expected stream-teardown cancellations as debug logs while preserving higher-severity logs for unrelated failures. ChangesExternal capability synchronization
Cancellation logging
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant StreamContext
participant FFmpeg
participant RTMPSegmenter
participant TrickleSubscriber
participant TrickleServer
StreamContext->>FFmpeg: Cancel context
FFmpeg-->>TrickleSubscriber: Process termination error
TrickleSubscriber->>TrickleSubscriber: Log cancellation at debug level
StreamContext->>RTMPSegmenter: Cancel context
RTMPSegmenter->>RTMPSegmenter: Log cancellation at debug level
StreamContext->>TrickleServer: Cancel client request
TrickleServer->>TrickleServer: Log disconnect at debug level
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@byoc/trickle.go`:
- Around line 407-411: Update the cmd.CombinedOutput logging branches in
byoc/trickle.go lines 407-411 and server/ai_live_video.go lines 453-457 to split
severity by error state: retain DEBUG logging for cancellation, use clog.Errorf
for non-cancellation err != nil failures, and call clog.Infof only when err ==
nil.
In `@core/ai_orchestrator.go`:
- Around line 1152-1175: Make ReserveExternalCapabilityCapacity perform the
capacity check and Load increment under the same cap.Mu write lock, returning a
capacity-exhausted error when Load is already at Capacity; update callers to
rely on this atomic reservation instead of the separate
CheckExternalCapabilityCapacity result, and add a concurrent reservation
regression test proving Load never exceeds Capacity.
In `@media/rtmp2segment.go`:
- Around line 73-77: The FFmpeg error path after cmd.CombinedOutput() still logs
cancellation-driven shutdowns at error level. Update the err != nil branch in
the segmentation flow to check ctx.Err() and use clog.V(common.DEBUG).Infof for
cancelled contexts, while retaining clog.Errorf for active-context failures,
matching the existing retry handling.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 399de4ad-377f-48f3-bf64-907b68b56e96
📒 Files selected for processing (13)
CHANGELOG_PENDING.mdbyoc/job_orchestrator.gobyoc/stream_orchestrator.gobyoc/trickle.gocore/ai_orchestrator.gocore/external_capabilities.gocore/external_capabilities_test.gocore/orchestrator.gomedia/rtmp2segment.goserver/ai_live_video.gotrickle/trickle_server.gotrickle/trickle_subscriber.gotrickle/trickle_test.go
|
Reviewed the remaining CodeRabbit docstring-coverage warning. It reports repository-wide coverage rather than a regression in this patch, and this change does not add a new docstring policy or require a broad comment-only sweep, so I left it out of scope. |
What does this pull request do?
Reduces expected teardown noise and removes unsynchronized external capability map reads.
Specific updates
How did you test each of these updates?
go test ./trickle -race -count=1./test.shand./test_e2e.sh, but the fork workflow runs currently require upstream maintainer approval../test.sh; the Docker engine became unresponsive during the cold-cache Go matrix before reporting a result. No repository files were changed by that verification attempt.Does this pull request close any open issues?
Fixes #3922
Fixes #3885
Checklist
Summary by CodeRabbit
Bug Fixes
Tests