From 84db3b7d551bdc43a2d3fe749413078ee2080bf6 Mon Sep 17 00:00:00 2001 From: Rashad Sookram Date: Tue, 26 Mar 2024 10:22:34 -0400 Subject: [PATCH] Log more info when select fails --- rtc_base/physical_socket_server.cc | 2 ++ rtc_base/thread.cc | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc index b5b4443eb4..5cb38ac7a4 100644 --- a/rtc_base/physical_socket_server.cc +++ b/rtc_base/physical_socket_server.cc @@ -1448,6 +1448,8 @@ bool PhysicalSocketServer::WaitSelect(int cmsWait, bool process_io) { if (n < 0) { if (errno != EINTR) { RTC_LOG_E(LS_ERROR, EN, errno) << "select"; + // RingRTC change to log more information around select failures. + RTC_LOG(LS_ERROR) << "select failed: fdmax=" << fdmax << ", cmsWait=" << cmsWait; return false; } // Else ignore the error and keep going. If this EINTR was for one of the diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc index 6f101ac8f4..1470056df3 100644 --- a/rtc_base/thread.cc +++ b/rtc_base/thread.cc @@ -846,8 +846,14 @@ bool Thread::ProcessMessages(int cmsLoop) { ScopedAutoReleasePool pool; #endif absl::AnyInvocable task = Get(cmsNext); - if (!task) - return !IsQuitting(); + // RingRTC change to log more information around select failures. + if (!task) { + bool isQuitting = IsQuitting(); + if (!isQuitting) { + RTC_LOG(LS_ERROR) << name_ << " will stop processing messages. cmsNext=" << cmsNext; + } + return !isQuitting; + } Dispatch(std::move(task)); if (cmsLoop != kForever) {