livekit / ingress

Ingest streams (RTMP/WHIP) or files (HLS, MP4) to LiveKit WebRTC
Apache License 2.0
66 stars 24 forks source link

Fix deadlock in appsrc #116

Closed biglittlebigben closed 1 year ago

biglittlebigben commented 1 year ago

This calls UnBind manually on the sample provider when the LocalSampleTrack fails, since it seems that Pion/the Go SDK do not. Is this the right approach, or should the fix be made in Pion or the SDK?

davidzhao commented 1 year ago

would be good to fix the root cause here, either in Pion or SDK

biglittlebigben commented 1 year ago

would be good to fix the root cause here, either in Pion or SDK

The SDK/Pion do end up calling Unbind, when we unpublish the whole track. However, here, the pipeline ends up entirely stuck when the Go SDK stops pulling samples for one of the variants because of the read error I generate for testing. This means the the GST EOF message is never received, the other variants never finish processing, and the track never gets unpublished.

I think calling Unbind manually is the right fix here, as it prevents the whole GST pipeline from being stuck by discarding buffers on the failed variant.