Fix a bug in TurnServer that causes flakiness in webrtc_perf_tests.

When a TCP TURN port is destroyed, a TURN refresh request with zero
lifetime is first sent to release the TURN allocation at the server,
and the underlying TCP connection is closed afterwards.

The closing of the TCP connection is handled first by the
VirtualSocketServer in our test infrastructure, and the corresponding
server socket is asynchronously destroyed at the TURN server. The
refresh request is however still passed to this server socket and
further signaled to the TURN server, which fails a DCHECK. The
server implementation should disable any firing of signals from a
server socket to be destroyed.

The bug id is set to None since this is a one-liner CL.

TBR=pthatcher@webrtc.org

Bug: None
Change-Id: Ib457b3800511a322ef69d67c71f2de05f3d67967
Reviewed-on: https://webrtc-review.googlesource.com/86501
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23809}
This commit is contained in:
Qingsi Wang
2018-07-02 10:48:25 -07:00
committed by Commit Bot
parent 312466a204
commit 0ea751539e

View File

@ -559,6 +559,7 @@ void TurnServer::DestroyInternalSocket(rtc::AsyncPacketSocket* socket) {
InternalSocketMap::iterator iter = server_sockets_.find(socket);
if (iter != server_sockets_.end()) {
rtc::AsyncPacketSocket* socket = iter->first;
socket->SignalReadPacket.disconnect(this);
server_sockets_.erase(iter);
// We must destroy the socket async to avoid invalidating the sigslot
// callback list iterator inside a sigslot callback. (In other words,