From 4a3d23f09232afd76157f099f6762fdc33a99d74 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 12 Aug 2026 12:30:53 -0400 Subject: [PATCH 1/3] fix(folderwatcher): recover from inotify (Linux) queue overflows Signed-off-by: Josh --- src/gui/folderwatcher_linux.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/folderwatcher_linux.cpp b/src/gui/folderwatcher_linux.cpp index 01fcdba1ae5e3..39ae2fb04adda 100644 --- a/src/gui/folderwatcher_linux.cpp +++ b/src/gui/folderwatcher_linux.cpp @@ -157,6 +157,13 @@ void FolderWatcherPrivate::slotReceivedNotification(int fd) continue; } + if (event->mask & IN_Q_OVERFLOW) { + qCWarning(lcFolderWatcher) + << "The inotify event queue overflowed; triggering a full local discovery"; + emit _parent->lostChanges(); + continue; + } + // Fire event for the path that was changed. if (event->len == 0 || event->wd <= -1) continue; From aed43ce9c1850035b52c434fe1424e8dfeb37892 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 12 Aug 2026 12:55:10 -0400 Subject: [PATCH 2/3] fix(folderwatcher): recover from Windows notification overflows Signed-off-by: Josh --- src/gui/folderwatcher_win.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/folderwatcher_win.cpp b/src/gui/folderwatcher_win.cpp index a46b429d8176b..895adf4380a8e 100644 --- a/src/gui/folderwatcher_win.cpp +++ b/src/gui/folderwatcher_win.cpp @@ -72,6 +72,7 @@ void WatcherThread::watchChanges(size_t fileNotifyBufferSize, const DWORD errorCode = GetLastError(); if (errorCode == ERROR_NOTIFY_ENUM_DIR) { qCDebug(lcFolderWatcher) << "The buffer for changes overflowed! Triggering a generic change and resizing"; + emit lostChanges(); emit changed(_path); *increaseBufferSize = true; } else { From c71c4f075c3f51b9acd595033e3fcf1903d92975 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 12 Aug 2026 13:24:03 -0400 Subject: [PATCH 3/3] fix(folderwatcher): process exact-size inotify events Signed-off-by: Josh --- src/gui/folderwatcher_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/folderwatcher_linux.cpp b/src/gui/folderwatcher_linux.cpp index 39ae2fb04adda..62b826244a2fb 100644 --- a/src/gui/folderwatcher_linux.cpp +++ b/src/gui/folderwatcher_linux.cpp @@ -149,7 +149,7 @@ void FolderWatcherPrivate::slotReceivedNotification(int fd) // iterate events in buffer unsigned int ulen = len; - for (i = 0; i + sizeof(inotify_event) < ulen; i += sizeof(inotify_event) + (event ? event->len : 0)) { + for (i = 0; i + sizeof(inotify_event) <= ulen; i += sizeof(inotify_event) + (event ? event->len : 0)) { // cast an inotify_event event = (struct inotify_event *)&buffer[i]; if (!event) {