Log more info when select fails

This commit is contained in:
Rashad Sookram 2024-03-26 10:22:34 -04:00 committed by GitHub
parent 8ee5fc9619
commit 84db3b7d55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -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

View file

@ -846,8 +846,14 @@ bool Thread::ProcessMessages(int cmsLoop) {
ScopedAutoReleasePool pool;
#endif
absl::AnyInvocable<void()&&> 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) {