Skip to content

Fix ghost producer#2017

Draft
seydx wants to merge 4 commits intoAlexxIT:masterfrom
seydx:fix-ghost-producer
Draft

Fix ghost producer#2017
seydx wants to merge 4 commits intoAlexxIT:masterfrom
seydx:fix-ghost-producer

Conversation

@seydx
Copy link
Contributor

@seydx seydx commented Jan 3, 2026

When a WebRTC client disconnects while a producer is still dialing, the producer keeps running forever with no consumers attached

Fix

Added IsClosed() to the Consumer interface. After Dial() completes, we now check if the consumer is still alive before adding tracks. If not, we bail out early so the producer can stop properly.

WebRTC implements this by tracking when the WebSocket transport closes during connection setup.

Note:
IsClosed() on the interface allows any consumer to implement proper closed-state detection. Right now only WebRTC needs it, but other consumers (RTSP, HomeKit, etc.) could implement it later if needed. The default in core.Connection returns false, so existing consumers work unchanged.

@seydx seydx marked this pull request as draft January 10, 2026 12:16
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 18, 2026

I wouldn't make any hasty changes to this logic. It's better to carefully rewrite the core from start to finish.

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