From 0ea751539e3a2e00d0449942b4c6993512e37b64 Mon Sep 17 00:00:00 2001 From: Qingsi Wang Date: Mon, 2 Jul 2018 10:48:25 -0700 Subject: [PATCH] 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 Reviewed-by: Seth Hampson Commit-Queue: Qingsi Wang Cr-Commit-Position: refs/heads/master@{#23809} --- p2p/base/turnserver.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/p2p/base/turnserver.cc b/p2p/base/turnserver.cc index 350ebd0119..b7ab2e3040 100644 --- a/p2p/base/turnserver.cc +++ b/p2p/base/turnserver.cc @@ -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,