Skip to content

fix(room-io): ownership-aware FrameProcessor lifecycle management#5467

Open
longcw wants to merge 1 commit intomainfrom
longc/frame-processor-lifecycle
Open

fix(room-io): ownership-aware FrameProcessor lifecycle management#5467
longcw wants to merge 1 commit intomainfrom
longc/frame-processor-lifecycle

Conversation

@longcw
Copy link
Copy Markdown
Contributor

@longcw longcw commented Apr 16, 2026

Summary

  • Add _processor_owned flag and _update_processor() to _ParticipantInputStream base class so it can distinguish externally-provided processors from selector-created ones
  • Direct FrameProcessor instances survive stream transitions (only closed on aclose())
  • Selector-created processors are closed when replaced or when the stream closes without replacement
  • aclose() closes unconditionally regardless of ownership

Fixes #5448, close #5467

The base class _ParticipantInputStream managed processor lifecycle in
_close_stream() without understanding processor ownership, causing
direct FrameProcessors to be killed on every track transition (#5448).

Add _processor_owned flag and _update_processor() method to the base
class. Direct processors (externally provided) survive stream
transitions; selector-created processors are closed when replaced or
when the stream closes without replacement. aclose() closes
unconditionally regardless of ownership.

Merge room_io test files into a single tests/test_room_io.py.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

AudioInputOptions.noise_cancellation: FrameProcessor killed by premature _close() in _close_stream() — processes zero frames

1 participant