Skip to content

Abandoned pending tracks are never released, so long-lived participants permanently hit too many pending tracks #4970

Closed

Description

@kevin-pan-skydio

Describe the bug

Since v1.13.6 (#4750), a participant can have at most cMaxPendingTracks = 20 pending tracks. A pending track is created by AddTrack and is removed from pendingTracks in only two places:

If a client calls AddTrack and then abandons the publish before any media flows, nothing releases the entry. With the Go SDK, abandoning means LocalParticipant.UnpublishTrack, which only does pc.RemoveTrack(sender) and renegotiates. No signal reaches the server that it acts on for pending tracks. The entry stays reserved until the participant leaves the room.

For a participant that stays in the room for hours and occasionally publishes tracks that never produce media, these abandoned entries pile up. After 20, every later AddTrack is rejected with LIMIT_EXCEEDED, including tracks that would carry media, until the participant disconnects.

Server

  • Version: v1.13.6 (also reproduced against master at 5a897c2)
  • Environment: self-hosted, Kubernetes
  • Default rtc config (reconnect_on_publication_error not set)

Client

  • SDK: server-sdk-go
  • Version: v2.16.6
  • A long-lived server-side participant that bridges video from devices into the room and publishes and unpublishes tracks on demand as streams come and go.

To Reproduce

Join a room with server-sdk-go and keep the participant connected.
Repeat 20 times: PublishTrack with a new local track, write no samples, then UnpublishTrack.
Call PublishTrack again.
The server rejects it with too many pending tracks, rejecting new track, numPendingTracks: 20. On the SDK side, PublishTrack blocks for its 10-second publish timeout and then fails. This repeats for every later publish until the participant reconnects.

Expected behavior

An AddTrack whose publish was abandoned and never received media should release its pending slot at some point, so the cap stays a guard against runaway clients and doesn't become a lifetime budget for a session.
Add any other context about the problem here.

Activity

  1. added a commit that references this issue on Oct 9, 2026
    278353f
  2. kevin-pan-skydio commented on Oct 12, 2026

    @kevin-pan-skydio
    Author

    @boks1971 maybe? 🙏 :ty:

  3. kevin-pan-skydio commented on Oct 12, 2026

    @kevin-pan-skydio
    Author
    Image

    Hello hello, I was able to repro this "ticking timebomb" behavior for long-lived participants. When we publish and unpublish the track enough times, and hitting the 20 pending tracks cap, we will eventually no longer be able to publish any tracks.

    It'd be great if we could get an upstream fix for this as soon as possible.

  4. added a commit that references this issue on Oct 13, 2026
    308554d
  5. boks1971 commented on Oct 13, 2026

    @boks1971
    Contributor

    Have addressed this in #4998. Turned out to be trickier than I anticipated. Thank you for #4971 . Please let us know if the limit poses any issues for you.

  6. kevin-pan-skydio commented on Oct 16, 2026

    @kevin-pan-skydio
    Author

    @boks1971 thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions