From 77740f1a6321027e891604035c7b0dac756ba991 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 8 Aug 2019 09:57:00 -0700 Subject: [PATCH 1/3] Report no. of packets dropped in checkForReadyReadBackup() --- libraries/networking/src/udt/Socket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 4714160ace..7229fc5955 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -337,9 +337,12 @@ void Socket::checkForReadyReadBackup() { // drop all of the pending datagrams on the floor + int droppedCount = 0; while (_udpSocket.hasPendingDatagrams()) { _udpSocket.readDatagram(nullptr, 0); + ++droppedCount; } + qCDebug(networking) << "Flushed" << droppedCount << "Packets"; } } From dbc2a677587781445c7cc2f3c889e718f266f61f Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 9 Aug 2019 09:46:09 -0700 Subject: [PATCH 2/3] Log event-queue size on readRead timeout --- libraries/networking/src/udt/Socket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 7229fc5955..c25075171b 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -334,7 +334,9 @@ void Socket::checkForReadyReadBackup() { qCDebug(networking) << "Socket::checkForReadyReadyBackup() last sequence number" << (uint32_t) _lastReceivedSequenceNumber << "from" << _lastPacketSockAddr << "-" << _lastPacketSizeRead << "bytes"; - +#ifdef DEBUG_EVENT_QUEUE + qCDebug(networking) << "NodeList event queue size:" << ::hifi::qt::getEventQueueSize(thread()); +#endif // drop all of the pending datagrams on the floor int droppedCount = 0; From 4de720a4568c4243dd7427e54cd12e605eb43c8b Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 9 Aug 2019 11:12:33 -0700 Subject: [PATCH 3/3] Enable the event-queue hack on Linux in addition to Windows --- assignment-client/src/avatars/AvatarMixerSlavePool.h | 2 +- libraries/shared/src/shared/QtHelpers.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixerSlavePool.h b/assignment-client/src/avatars/AvatarMixerSlavePool.h index c8f4c252b1..915c6d8dc4 100644 --- a/assignment-client/src/avatars/AvatarMixerSlavePool.h +++ b/assignment-client/src/avatars/AvatarMixerSlavePool.h @@ -75,7 +75,7 @@ public: void each(std::function functor); #ifdef DEBUG_EVENT_QUEUE - void AvatarMixerSlavePool::queueStats(QJsonObject& stats); + void queueStats(QJsonObject& stats); #endif void setNumThreads(int numThreads); diff --git a/libraries/shared/src/shared/QtHelpers.h b/libraries/shared/src/shared/QtHelpers.h index cde6ecdbb7..f57ba4af2d 100644 --- a/libraries/shared/src/shared/QtHelpers.h +++ b/libraries/shared/src/shared/QtHelpers.h @@ -12,10 +12,10 @@ #include -#ifdef WIN32 +#if defined(Q_OS_WIN) || defined(Q_OS_LINUX) // Enable event queue debugging #define DEBUG_EVENT_QUEUE -#endif // WIN32 +#endif namespace hifi { namespace qt { void addBlockingForbiddenThread(const QString& name, QThread* thread = nullptr);