Skip to content

File descriptor leak in ICE runner task. #8

@tizoc

Description

@tizoc

We observed steadily rising open file descriptors count in long‑running applications using rustrtc when peer connections are created and closed repeatedly. The FD count grows quickly over time and does not return to baseline.

Root cause appears to be ICE lifecycle cleanup: the ICE runner task never exits on Closed, and gathered UDP sockets / TURN clients remain referenced after IceTransport::stop(), so their FDs stay open.

I implemented this fix in our fork, which seems to have worked, I can submit a PR if you think it looks good:

  • Exit IceTransportRunner when ICE state becomes Closed (so it doesn’t retain Arc<IceTransportInner>) forever).
  • In IceTransport::stop(), clear IceGatherer socket and TURN client collections and reset selected socket/pair.

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