PeerConnection doesn't close UDP ports it doesn't use anymore. |
|||||
Issue descriptionIt appears that PeerConnection never closes UDP ports which it doesn't need. See b/31748068 for details P2PTransportChannel keeps a set of PortAllocatorSession instances in allocator_sessions_, see https://codesearch.chromium.org/chromium/src/third_party/webrtc/p2p/base/p2ptransportchannel.h?rcl=1480681004&l=361 . Each session keeps one UDP socket. Problem is that these sessions are never deleted during lifetime of connections. P2PTransportChannel can add new sessions, but never removes them. As result all UDP ports are kept open until P2PTransportChannel is destroyed.
,
Dec 2 2016
I was just recently reading the code and noticed this problem. We do delete "Port" objects when they're not used, but when two Ports share a socket, it's the BasicPortAllocatorSession that owns the socket: https://codesearch.chromium.org/chromium/src/third_party/webrtc/p2p/client/basicportallocator.h?q=basicportall&sq=package:chromium&l=368 We need to either change this model, or start doing some kind of reference counting.
,
Feb 15 2017
,
Sep 30 2017
Any chance this long-standing issue can be addressed soon? A seemingly not-so-hard-to-implement fix could save gazillions of kWh for computers all over the world prevented by Chromium/Chrome from suspending on inactivity.
,
Oct 2 2017
It's not the highest priority right now, but if it's impacting you, you're welcome to take a stab at it. https://webrtc.org/contributing/
,
Oct 3 2017
Argh, I moved off Chromium in 2015, but chances are I'll take a look at it.
,
Mar 13 2018
,
Jun 27 2018
Is this bug fixed? PeerConnection doesn't close UDP ports after calling peerconnection close, And this maybe cause too many open files for Android?
,
Jun 27 2018
The bug is not fixed, but calling PeerConnection::Close *will* close all ports.
,
Jun 28 2018
We call PeerConnection::Close, but stun binding request send periodically, and do not know when udp port are going to be closed
,
Jun 28 2018
I find the bug is fixed, after calling PeerConnection::Close, then PeerConnection::~PeerConnection is called, and udp port are going to be closed. Previous code has bug, because stl container hold PeerConnection for a long time.
,
Aug 2
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by kmackay@chromium.org
, Dec 2 2016